diff options
author | Xin Li <delphij@google.com> | 2024-01-18 13:56:04 -0800 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2024-01-18 13:56:04 -0800 |
commit | 6810c1964607b9e75893c6af2efe82df87625653 (patch) | |
tree | 8acf8209b0a1a7899151b491f5894ad57bb88411 /src/com/android/launcher3/PagedView.java | |
parent | 507cccdb174d25c7d3b5f802741e50041f6e5929 (diff) | |
parent | b7a5eb9ef418c9dce6f597244d2fb5b9b491610d (diff) | |
download | Launcher3-6810c1964607b9e75893c6af2efe82df87625653.tar.gz |
Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: I0708bf3c060ba84089722d0bd9480a4f4bd2b8e2
Change-Id: I31bb7f6aa8f71244f6e44903927f67e9d3a85642
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 4b4a4a5204..f355ae7128 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -19,6 +19,7 @@ package com.android.launcher3; import static com.android.app.animation.Interpolators.SCROLL; import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled; import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType; +import static com.android.launcher3.testing.shared.TestProtocol.SCROLL_FINISHED_MESSAGE; import static com.android.launcher3.touch.OverScroll.OVERSCROLL_DAMP_FACTOR; import static com.android.launcher3.touch.PagedOrientationHandler.VIEW_SCROLL_BY; import static com.android.launcher3.touch.PagedOrientationHandler.VIEW_SCROLL_TO; @@ -492,7 +493,8 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou */ protected void onPageEndTransition() { mCurrentPageScrollDiff = 0; - AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext()); + AccessibilityManagerCompat.sendTestProtocolEventToTest(getContext(), + SCROLL_FINISHED_MESSAGE); AccessibilityManagerCompat.sendCustomAccessibilityEvent(getPageAt(mCurrentPage), AccessibilityEvent.TYPE_VIEW_FOCUSED, null); if (mOnPageTransitionEndCallback != null) { @@ -1571,7 +1573,9 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou @Override public void requestChildFocus(View child, View focused) { super.requestChildFocus(child, focused); - + if (!shouldHandleRequestChildFocus()) { + return; + } // In case the device is controlled by a controller, mCurrentPage isn't updated properly // which results in incorrect navigation int nextPage = getNextPage(); @@ -1585,6 +1589,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou } } + protected boolean shouldHandleRequestChildFocus() { + return true; + } + public int getDestinationPage() { return getDestinationPage(mOrientationHandler.getPrimaryScroll(this)); } |