summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-09-17 17:14:46 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-09-17 17:14:46 +0000
commit4ca6449e396811c12ec589a332fb5767970b7d3d (patch)
treea0ace324751a327b2cab4a564e61e5f1127386c2 /src
parent570d9a1e9c7ad2d9b40f1aaa27a43b19a9bede64 (diff)
parent3ad4ace203c73aebac98010812703dbb6879d55d (diff)
downloadpackages_apps_Trebuchet-4ca6449e396811c12ec589a332fb5767970b7d3d.tar.gz
packages_apps_Trebuchet-4ca6449e396811c12ec589a332fb5767970b7d3d.tar.bz2
packages_apps_Trebuchet-4ca6449e396811c12ec589a332fb5767970b7d3d.zip
Merge "Revert "support scroll backward to minus one screen via voice/switch access"" into ub-launcher3-qt-future-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/PagedView.java22
-rw-r--r--src/com/android/launcher3/Workspace.java7
2 files changed, 7 insertions, 22 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 4f5b1cd67..f9a326f4e 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -1543,7 +1543,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
snapToPage(getNextPage() - 1);
return true;
}
- return onOverscroll(-getMeasuredWidth());
+ return false;
}
public boolean scrollRight() {
@@ -1551,15 +1551,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
snapToPage(getNextPage() + 1);
return true;
}
- return onOverscroll(getMeasuredWidth());
- }
-
- protected boolean onOverscroll(int amount) {
- if (!mAllowOverScroll) return false;
- onScrollInteractionBegin();
- overScroll(amount);
- onScrollInteractionEnd();
- return true;
+ return false;
}
@Override
@@ -1579,9 +1571,8 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
final boolean pagesFlipped = isPageOrderFlipped();
- int offset = (mAllowOverScroll ? 0 : 1);
- info.setScrollable(getPageCount() > offset);
- if (getCurrentPage() < getPageCount() - offset) {
+ info.setScrollable(getPageCount() > 1);
+ if (getCurrentPage() < getPageCount() - 1) {
info.addAction(pagesFlipped ?
AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD
: AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
@@ -1589,7 +1580,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_LEFT
: AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_RIGHT);
}
- if (getCurrentPage() >= offset) {
+ if (getCurrentPage() > 0) {
info.addAction(pagesFlipped ?
AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD
: AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
@@ -1597,6 +1588,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_RIGHT
: AccessibilityNodeInfo.AccessibilityAction.ACTION_PAGE_LEFT);
}
+
// Accessibility-wise, PagedView doesn't support long click, so disabling it.
// Besides disabling the accessibility long-click, this also prevents this view from getting
// accessibility focus.
@@ -1615,7 +1607,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
- event.setScrollable(mAllowOverScroll || getPageCount() > 1);
+ event.setScrollable(getPageCount() > 1);
}
@Override
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 1cb15db98..f9201d04c 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1035,13 +1035,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
}
@Override
- protected boolean onOverscroll(int amount) {
- // Enforce overscroll on -1 direction
- if ((amount > 0 && !mIsRtl) || (amount < 0 && mIsRtl)) return false;
- return super.onOverscroll(amount);
- }
-
- @Override
protected boolean shouldFlingForVelocity(int velocityX) {
// When the overlay is moving, the fling or settle transition is controlled by the overlay.
return Float.compare(Math.abs(mOverlayTranslation), 0) == 0 &&