Merge "Reset fast scroller when All Apps resets." into tm-qpr-dev am: 5969e0524a am: 199eb1f5b3

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21406904

Change-Id: I62d3f2949704e68031894aeea77e395685ce6bd5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Andy Wickham
2023-02-20 20:33:51 +00:00
committed by Automerger Merge Worker
2 changed files with 17 additions and 9 deletions
@@ -360,6 +360,9 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
mAH.get(i).mRecyclerView.scrollToTop(); mAH.get(i).mRecyclerView.scrollToTop();
} }
} }
if (mTouchHandler != null) {
mTouchHandler.endFastScrolling();
}
if (mHeader != null && mHeader.getVisibility() == VISIBLE) { if (mHeader != null && mHeader.getVisibility() == VISIBLE) {
mHeader.reset(animate); mHeader.reset(animate);
} }
@@ -283,15 +283,7 @@ public class RecyclerViewFastScroller extends View {
break; break;
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_CANCEL:
mRv.onFastScrollCompleted(); endFastScrolling();
mTouchOffsetY = 0;
mLastTouchY = 0;
mIgnoreDragGesture = false;
if (mIsDragging) {
mIsDragging = false;
animatePopupVisibility(false);
showActiveScrollbar(false);
}
break; break;
} }
if (DEBUG) { if (DEBUG) {
@@ -330,6 +322,19 @@ public class RecyclerViewFastScroller extends View {
setThumbOffsetY((int) mLastTouchY); setThumbOffsetY((int) mLastTouchY);
} }
/** End any active fast scrolling touch handling, if applicable. */
public void endFastScrolling() {
mRv.onFastScrollCompleted();
mTouchOffsetY = 0;
mLastTouchY = 0;
mIgnoreDragGesture = false;
if (mIsDragging) {
mIsDragging = false;
animatePopupVisibility(false);
showActiveScrollbar(false);
}
}
public void onDraw(Canvas canvas) { public void onDraw(Canvas canvas) {
if (mThumbOffsetY < 0) { if (mThumbOffsetY < 0) {
return; return;