summaryrefslogtreecommitdiff
path: root/services/accessibility
diff options
context:
space:
mode:
author Longbo Wei <longbowei@google.com> 2025-03-14 21:12:00 +0000
committer Longbo Wei <longbowei@google.com> 2025-03-14 14:17:35 -0700
commit7b4cf9c4fa94842df9a2a111e3c613ceeb66ce30 (patch)
tree582fc1e5cc7c894e6386ef0dda2474c733c3a29f /services/accessibility
parentce63dc85ddbd2390b76ce3ec26e690e87e16d6a6 (diff)
a11y: Remove indicator when hovering on directional buttons
Autoclick indicator appears on all scroll panel buttons, causing visual distraction during scrolling. We should remove the indicator when it is on directional buttons. Video: http://shortn/_XJT8X9VxAF Bug: b/403624552 Test: AutoclickControllerTest Flag: com.android.server.accessibility.enable_autoclick_indicator Change-Id: Ia0fb0387e6e1d3ee1cf846a8c7dfaa9f0967fd51
Diffstat (limited to 'services/accessibility')
-rw-r--r--services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java b/services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java
index 0b9c45de6e40..60343e9e81e5 100644
--- a/services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java
+++ b/services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java
@@ -152,9 +152,20 @@ public class AutoclickController extends BaseEventStreamTransformation {
if (direction == AutoclickScrollPanel.DIRECTION_EXIT) {
return;
}
- // For direction buttons, perform scroll action immediately.
- if (hovered && direction != AutoclickScrollPanel.DIRECTION_NONE) {
- handleScroll(direction);
+
+ // Handle all non-exit buttons when hovered.
+ if (hovered) {
+ // Clear the indicator.
+ if (mAutoclickIndicatorScheduler != null) {
+ mAutoclickIndicatorScheduler.cancel();
+ if (mAutoclickIndicatorView != null) {
+ mAutoclickIndicatorView.clearIndicator();
+ }
+ }
+ // Perform scroll action.
+ if (direction != DIRECTION_NONE) {
+ handleScroll(direction);
+ }
}
}
};