[Predictive Back] Widget to home polish: show extra rows at bottom during animation

1. setClipChildren(false) for WidgetFullSheet and content view during animation
2. setClipToOutline(true) for WidgetsRecyclerView and provide ViewOutlineProvider to expand bottom by 5% of height
3. Override calculateExtraLayoutSpace() for ScrollableLayoutManager
4. Manually modify AbstractSlideInView#mContent's background drawable during scale animation

bug: b/260956481
Test: manual

Change-Id: Ic391639de887cf4a70bc4965dc0b1fd9bc12dd2c
This commit is contained in:
Fengjiang Li
2023-02-11 11:01:58 -08:00
parent 740541e0a0
commit cb640da2bb
14 changed files with 134 additions and 33 deletions
@@ -21,7 +21,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import androidx.annotation.Px;
import androidx.core.view.accessibility.AccessibilityEventCompat;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
import androidx.core.view.accessibility.AccessibilityRecordCompat;
@@ -145,19 +144,6 @@ public class AllAppsGridAdapter<T extends Context & ActivityContext> extends
cic.isSelected()));
}
/**
* We need to extend all apps' RecyclerView's bottom by 5% of view height to ensure extra
* roll(s) of app icons is rendered at the bottom, so that they can fill the bottom gap
* created during predictive back's scale animation from all apps to home.
*/
@Override
protected void calculateExtraLayoutSpace(RecyclerView.State state, int[] extraLayoutSpace) {
super.calculateExtraLayoutSpace(state, extraLayoutSpace);
@Px int extraSpacePx = (int) (getHeight()
* (1 - AllAppsTransitionController.SWIPE_ALL_APPS_TO_HOME_MIN_SCALE) / 2);
extraLayoutSpace[1] = Math.max(extraLayoutSpace[1], extraSpacePx);
}
/**
* Returns the number of rows before {@param adapterPosition}, including this position
* which should not be counted towards the collection info.