Merge "[PS] Add emphasized interpolators when clicking the PS tile to scroll to bottom." into main
diff --git a/src/com/android/launcher3/FastScrollRecyclerView.java b/src/com/android/launcher3/FastScrollRecyclerView.java
index 01e65ae..a13dcc1 100644
--- a/src/com/android/launcher3/FastScrollRecyclerView.java
+++ b/src/com/android/launcher3/FastScrollRecyclerView.java
@@ -27,6 +27,7 @@
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
+import com.android.app.animation.Interpolators;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.views.RecyclerViewFastScroller;
@@ -194,12 +195,13 @@
}
/**
- * Scrolls this recycler view to the bottom.
+ * Scrolls this recycler view to the bottom with easing and duration.
*/
- public void scrollToBottom() {
+ public void scrollToBottomWithMotion() {
if (mScrollbar != null) {
mScrollbar.reattachThumbToScroll();
}
- smoothScrollToPosition(getAdapter().getItemCount() - 1);
+ // Emphasized interpolators with 500ms duration
+ smoothScrollBy(0, getAvailableScrollHeight(), Interpolators.EMPHASIZED, 500);
}
}
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index c9e5b1e..e5a223a 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -515,7 +515,7 @@
// Switch to the main tab
switchToTab(ActivityAllAppsContainerView.AdapterHolder.MAIN);
// Scroll to bottom
- getActiveRecyclerView().scrollToBottom();
+ getActiveRecyclerView().scrollToBottomWithMotion();
});
}