Skip to content

Drag lists that refuse scroll actions when swiping past their last item - #277

Merged
trypsynth merged 2 commits into
masterfrom
drag-unscrollable-lists
Oct 27, 2026
Merged

trypsynth merged 2 commits into
masterfrom
drag-unscrollable-lists

Conversation

@trypsynth

Copy link
Copy Markdown
Owner

Fixes #150

Problem

The Kindle library list reports scrollable=false and refuses ACTION_SCROLL_FORWARD and ACTION_SCROLL_BACKWARD, and so does every container above it. Swiping stopped at the fifth book, so a bigger library was partly out of reach. A real two-finger drag does scroll it.

Change

  • autoScrollAtEdge used to return when no scrollable container was found. If the pivot is inside a list or grid that refuses all scroll actions, it now calls the new dragUnscrollableList.
  • New focusmanagement/DragScroller.kt:
    • Checks that the next focusable item in the swipe direction is outside the list, so the pivot is the last item on screen.
    • Drags the list with two fingers, which touch exploration passes through to the app. A one-finger drag would be explored instead.
    • The drag moves the pivot to the far edge of the list, so nothing is skipped. The fingers hold still for 100 ms with continueStroke before they lift, so the list doesn't fling.
    • After the drag, it checks whether the pivot moved. If it did, onAutoScrolled moves focus to the next item, the same as after a normal auto-scroll. If not, onAutoScrollFailed leaves the list, as before this change.
  • A list that fits on screen refuses scroll actions too. So it only drags when the list's row count shows more rows, or, when there's no row count, the pivot reaches the list's edge. From an item where a drag already failed, it doesn't drag again.
  • The ancestor check comes first, so screens without such a list pay only an ancestor walk.
  • Only in the default granularity, vertical and logical directions, and not on TV.
  • differences.md has a section under Navigation.

Testing

  • DragScrollerTest: drag geometry (forward, backward, clamping, an empty list), directions, row and edge checks, and which nodes count as a list that refuses scroll actions.
  • :talkback:testPhoneDebugUnitTest (542 tests) and :lintPhoneDebug pass.
  • Not tested on a device. It needs checking in the Kindle library: that the injected two-finger drag scrolls it, that focus moves on to the next book, and that swiping off the last book still reaches the bottom tabs.

Some lists, such as the Kindle library, say they can't scroll and refuse the scroll actions, yet
scroll when dragged, so swiping stopped at the last item on screen. When a swipe passes the last
item on screen in such a list, Backtalk now drags the list with two fingers, which touch
exploration passes through, holds still before lifting so the list doesn't fling, and moves on to
the next item. When nothing moves, the list is at its end and swiping leaves it as before.

A list that fits on screen refuses scroll actions too, so a drag needs a sign that there is more:
the list's row count, or the item reaching the list's edge as an item cut off by it does.

Fixes #150
@trypsynth
trypsynth merged commit 105b0ff into master Oct 27, 2026
2 checks passed
trypsynth added a commit that referenced this pull request Oct 28, 2026
Removes the Explore by touch developer setting, which left Backtalk unusable by touch when turned off. Touch exploration is now always requested on touch screens, except while the braille keyboard or a pause turns it off.

Reverts #277. On a Galaxy S25, the dispatched two-finger drag came back through touch exploration as an exploration drag, so the Kindle library never moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kindle Library list cannot be scrolled by a screen reader, and does not accept the accessibility scroll action

1 participant