Loading src/com/android/launcher3/FastScrollRecyclerView.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -197,11 +197,11 @@ public abstract class FastScrollRecyclerView extends RecyclerView { /** /** * Scrolls this recycler view to the bottom with easing and duration. * Scrolls this recycler view to the bottom with easing and duration. */ */ public void scrollToBottomWithMotion() { public void scrollToBottomWithMotion(int duration) { if (mScrollbar != null) { if (mScrollbar != null) { mScrollbar.reattachThumbToScroll(); mScrollbar.reattachThumbToScroll(); } } // Emphasized interpolators with 500ms duration // Emphasized interpolators with 500ms duration smoothScrollBy(0, getAvailableScrollHeight(), Interpolators.EMPHASIZED, 500); smoothScrollBy(0, getAvailableScrollHeight(), Interpolators.EMPHASIZED, duration); } } } } src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -126,6 +126,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> public static final float PULL_MULTIPLIER = .02f; public static final float PULL_MULTIPLIER = .02f; public static final float FLING_VELOCITY_MULTIPLIER = 1200f; public static final float FLING_VELOCITY_MULTIPLIER = 1200f; protected static final String BUNDLE_KEY_CURRENT_PAGE = "launcher.allapps.current_page"; protected static final String BUNDLE_KEY_CURRENT_PAGE = "launcher.allapps.current_page"; private static final int SCROLL_TO_BOTTOM_DURATION = 500; private static final long DEFAULT_SEARCH_TRANSITION_DURATION_MS = 300; private static final long DEFAULT_SEARCH_TRANSITION_DURATION_MS = 300; // Render the header protection at all times to debug clipping issues. // Render the header protection at all times to debug clipping issues. private static final boolean DEBUG_HEADER_PROTECTION = false; private static final boolean DEBUG_HEADER_PROTECTION = false; Loading Loading @@ -515,7 +516,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> // Switch to the main tab // Switch to the main tab switchToTab(ActivityAllAppsContainerView.AdapterHolder.MAIN); switchToTab(ActivityAllAppsContainerView.AdapterHolder.MAIN); // Scroll to bottom // Scroll to bottom getActiveRecyclerView().scrollToBottomWithMotion(); getActiveRecyclerView().scrollToBottomWithMotion(SCROLL_TO_BOTTOM_DURATION); }); }); } } Loading src/com/android/launcher3/allapps/PrivateSpaceHeaderViewController.java +1 −5 Original line number Original line Diff line number Diff line Loading @@ -120,11 +120,7 @@ public class PrivateSpaceHeaderViewController { (ActivityAllAppsContainerView<?>.AdapterHolder) mAllApps.mAH.get(MAIN); (ActivityAllAppsContainerView<?>.AdapterHolder) mAllApps.mAH.get(MAIN); if (Flags.enablePrivateSpace() && Flags.privateSpaceAnimation() if (Flags.enablePrivateSpace() && Flags.privateSpaceAnimation() && mAllApps.getActiveRecyclerView() == mainAdapterHolder.mRecyclerView) { && mAllApps.getActiveRecyclerView() == mainAdapterHolder.mRecyclerView) { RecyclerViewAnimationController recyclerViewAnimationController = mAllApps.getActiveRecyclerView().scrollToBottomWithMotion(ANIMATION_DURATION); new RecyclerViewAnimationController(mAllApps); recyclerViewAnimationController.animateToState(true /* expand */, ANIMATION_DURATION, () -> {}); mAllApps.getActiveRecyclerView().scrollToBottomWithMotion(); } } } } Loading Loading
src/com/android/launcher3/FastScrollRecyclerView.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -197,11 +197,11 @@ public abstract class FastScrollRecyclerView extends RecyclerView { /** /** * Scrolls this recycler view to the bottom with easing and duration. * Scrolls this recycler view to the bottom with easing and duration. */ */ public void scrollToBottomWithMotion() { public void scrollToBottomWithMotion(int duration) { if (mScrollbar != null) { if (mScrollbar != null) { mScrollbar.reattachThumbToScroll(); mScrollbar.reattachThumbToScroll(); } } // Emphasized interpolators with 500ms duration // Emphasized interpolators with 500ms duration smoothScrollBy(0, getAvailableScrollHeight(), Interpolators.EMPHASIZED, 500); smoothScrollBy(0, getAvailableScrollHeight(), Interpolators.EMPHASIZED, duration); } } } }
src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -126,6 +126,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> public static final float PULL_MULTIPLIER = .02f; public static final float PULL_MULTIPLIER = .02f; public static final float FLING_VELOCITY_MULTIPLIER = 1200f; public static final float FLING_VELOCITY_MULTIPLIER = 1200f; protected static final String BUNDLE_KEY_CURRENT_PAGE = "launcher.allapps.current_page"; protected static final String BUNDLE_KEY_CURRENT_PAGE = "launcher.allapps.current_page"; private static final int SCROLL_TO_BOTTOM_DURATION = 500; private static final long DEFAULT_SEARCH_TRANSITION_DURATION_MS = 300; private static final long DEFAULT_SEARCH_TRANSITION_DURATION_MS = 300; // Render the header protection at all times to debug clipping issues. // Render the header protection at all times to debug clipping issues. private static final boolean DEBUG_HEADER_PROTECTION = false; private static final boolean DEBUG_HEADER_PROTECTION = false; Loading Loading @@ -515,7 +516,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> // Switch to the main tab // Switch to the main tab switchToTab(ActivityAllAppsContainerView.AdapterHolder.MAIN); switchToTab(ActivityAllAppsContainerView.AdapterHolder.MAIN); // Scroll to bottom // Scroll to bottom getActiveRecyclerView().scrollToBottomWithMotion(); getActiveRecyclerView().scrollToBottomWithMotion(SCROLL_TO_BOTTOM_DURATION); }); }); } } Loading
src/com/android/launcher3/allapps/PrivateSpaceHeaderViewController.java +1 −5 Original line number Original line Diff line number Diff line Loading @@ -120,11 +120,7 @@ public class PrivateSpaceHeaderViewController { (ActivityAllAppsContainerView<?>.AdapterHolder) mAllApps.mAH.get(MAIN); (ActivityAllAppsContainerView<?>.AdapterHolder) mAllApps.mAH.get(MAIN); if (Flags.enablePrivateSpace() && Flags.privateSpaceAnimation() if (Flags.enablePrivateSpace() && Flags.privateSpaceAnimation() && mAllApps.getActiveRecyclerView() == mainAdapterHolder.mRecyclerView) { && mAllApps.getActiveRecyclerView() == mainAdapterHolder.mRecyclerView) { RecyclerViewAnimationController recyclerViewAnimationController = mAllApps.getActiveRecyclerView().scrollToBottomWithMotion(ANIMATION_DURATION); new RecyclerViewAnimationController(mAllApps); recyclerViewAnimationController.animateToState(true /* expand */, ANIMATION_DURATION, () -> {}); mAllApps.getActiveRecyclerView().scrollToBottomWithMotion(); } } } } Loading