Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6a8e075 authored by Longbo Wei's avatar Longbo Wei
Browse files

a11y: Prevent scroll position update when hovered on panels

Problem: When the cursor hovers over scrollable content, it scrolls as
expected. However, if the cursor moves to the scroll panel, sendClick
updates the scrollPanel position to be (mLastCursorX, mLastCursorY) from
mLastMotion. Ideally, the scroll position should only be updated when
cursor is not on the panel.

Fix: Add mScrollCursorX, mScrollCursorY and perform scroll at
(mScrollCursorX, mScrollCursorY) instead of (mLastCursorX,
mLastCursorY), meanwhile, only update mScrollCursorX, mScrollCursorY
when panels is not hovered.

Note: To detect hovering, built-in function mContentView.isHovered() is
used, and same to this CL - http://ag/31887076

"When the panel is a standard LinearLayout,the View api
setOnHoverListener() does not work for this use case becasuse of the
child button elements. When the button elements become hovered, the
LinearLayout panel considers that as an "ACTION_HOVER_EXIT" even though
the button is actually inside the panel. "

Therefore, to properly use the mContentView.isHovered(), This CL updates
to use com.android.server.accessibility.autoclick.AutoclickLinearLayout.

Video:
 - Before: http://shortn/_yf42nN9HAX
 - After:  http://shortn/_Mb3c7HaY2g

Bug: b/406326893
Test: AutoclickControllerTest
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: I2d3e5b1b9fff0578019d9d97edc5d57d99a2c1d6
parent 6e602138
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment