From ee5867e98054b9564b8a8a19981b38bd9074b998 Mon Sep 17 00:00:00 2001 From: Liam Lee Pong Lam Date: Mon, 3 Jun 2024 19:00:14 +0000 Subject: [PATCH] Revert "[Launcher3] Hide keyboard when fastscroller scrolling down and keyboard" This reverts commit 883a79db715258e92b738357771078548920df65. Reason for revert: Revert this change because it caused other bug b/343285163 Change-Id: I1fdb21cc4a5cdcf2c22e9b1927753b290626289c --- .../views/RecyclerViewFastScroller.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/com/android/launcher3/views/RecyclerViewFastScroller.java b/src/com/android/launcher3/views/RecyclerViewFastScroller.java index cdbd0c0be7..df8f635525 100644 --- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java +++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java @@ -109,13 +109,6 @@ public class RecyclerViewFastScroller extends View { private float mLastTouchY; private boolean mIsDragging; - /** - * Tracks whether a keyboard hide request has been sent due to downward scrolling. - *

- * Set to true when scrolling down and reset when scrolling up to prevents redundant hide - * requests during continuous downward scrolls. - */ - private boolean mRequestedHideKeyboard; private boolean mIsThumbDetached; private final boolean mCanThumbDetach; private boolean mIgnoreDragGesture; @@ -248,7 +241,6 @@ public class RecyclerViewFastScroller extends View { public boolean handleTouchEvent(MotionEvent ev, Point offset) { int x = (int) ev.getX() - offset.x; int y = (int) ev.getY() - offset.y; - ActivityContext activityContext = ActivityContext.lookupContext(getContext()); switch (ev.getAction()) { case MotionEvent.ACTION_DOWN: @@ -256,7 +248,6 @@ public class RecyclerViewFastScroller extends View { mDownX = x; mDownY = mLastY = y; mDownTimeStampMillis = ev.getDownTime(); - mRequestedHideKeyboard = false; if ((Math.abs(mDy) < mDeltaThreshold && mRv.getScrollState() != SCROLL_STATE_IDLE)) { @@ -269,15 +260,6 @@ public class RecyclerViewFastScroller extends View { } break; case MotionEvent.ACTION_MOVE: - if (y > mLastY) { - if (!mRequestedHideKeyboard) { - activityContext.hideKeyboard(); - } - mRequestedHideKeyboard = true; - } else { - mRequestedHideKeyboard = false; - } - mLastY = y; int absDeltaY = Math.abs(y - mDownY); int absDeltaX = Math.abs(x - mDownX); @@ -312,6 +294,7 @@ public class RecyclerViewFastScroller extends View { } private void calcTouchOffsetAndPrepToFastScroll(int downY, int lastY) { + ActivityContext.lookupContext(getContext()).hideKeyboard(); mIsDragging = true; if (mCanThumbDetach) { mIsThumbDetached = true;