From 817054d0005b038c26e21cab8055648ecb4c5275 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Mon, 15 Jun 2020 14:12:53 -0700 Subject: [PATCH] fix a11y issue where scroll next can still be triggered on final page in RecentsView Bug: 151450844 Test: manual verification with following steps 1. launch a few apps 2. swipe up from bottom to bring up RecentsView 3. enable talkback 4. perform a scroll next a11y gesture (without lifting finger, swipe right then left) 5. verify nothing happens (as opposed to pushing the page back a little) Change-Id: I6dea2559592bdaa7227a2e12ce0565d6d7b7f4a1 --- .../src/com/android/quickstep/views/RecentsView.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index 873c672625..2066d52c36 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -2111,6 +2111,12 @@ public abstract class RecentsView extends PagedView impl return mClearAllButton; } + @Override + protected boolean onOverscroll(int amount) { + // overscroll should only be accepted on -1 direction (for clear all button) + if ((amount > 0 && !mIsRtl) || (amount < 0 && mIsRtl)) return false; + return super.onOverscroll(amount); + } /** * @return How many pixels the running task is offset on the currently laid out dominant axis.