summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/PagedView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r--src/com/android/launcher3/PagedView.java12
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));
}