commit | 454590d7ea6e2e4520f42f2baa91a86990925257 | [log] [tgz] |
---|---|---|
author | Holly Sun <jiuyu@google.com> | Mon Nov 27 13:39:38 2023 -0800 |
committer | Holly Sun <jiuyu@google.com> | Mon Nov 27 16:42:33 2023 -0800 |
tree | c0e619fb6c3d52b57fe5d5a04b85c7ebe1da96aa | |
parent | 2b352f6c5fe5e17dce3da63eaa7a1e27b98e385a [diff] [blame] |
[PS] Add emphasized interpolators when clicking the PS tile to scroll to bottom. UX spec: https://carbon.googleplex.com/google-material-3/pages/easing-and-duration/tokens-specs/bd8df608-11ee-48f9-b93d-90d74e3d35c8#5fa37127-0934-4c47-804e-cb2fbf47f73d. Use the first column "Emphasized" one. Duration: 500ms video: https://drive.google.com/file/d/1EYlkWVgiYFy0IB5WnQRVoQ9b_sbEkLj7/view?usp=sharing Bug: 309522136 Test: manual Flag: ACONFIG com.google.android.apps.nexuslauncher.inject_private_space_tile DEVELOPMENT Change-Id: I178c075ebf5db8338f476d0607caabec7b8c7fde
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); } }