Skip to content

fix #17922: enable auto advance with long-press#20335

Open
Ayush-Patel-56 wants to merge 1 commit intoankidroid:mainfrom
Ayush-Patel-56:fix-auto-advance-long-press
Open

fix #17922: enable auto advance with long-press#20335
Ayush-Patel-56 wants to merge 1 commit intoankidroid:mainfrom
Ayush-Patel-56:fix-auto-advance-long-press

Conversation

@Ayush-Patel-56
Copy link
Contributor

Purpose / Description

Auto Advance stops working when "Show answer long-press time" is set to anything other than 0 in Accessibility settings.

Fixes

Approach

When long-press time is enabled, the show-answer button was only getting an OnTouchListener — the OnClickListener was skipped entirely. Auto Advance triggers the button via performClick(), which only fires the OnClickListener, so it silently did nothing.

The fix is straightforward: always set the OnClickListener. When long-press is also enabled, the OnTouchListener intercepts manual touches (returning true to consume them), while performClick() still works through the click listener as expected.

How Has This Been Tested?

Tested manually on an emulator (API 30):

  • Auto Advance with long-press disabled — works as before
  • Auto Advance with long-press set to 500ms — now correctly flips the card
  • Manual tap with long-press enabled — still respects the delay
  • Manual tap with long-press disabled — unchanged

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

always set onclicklistener to support performclick().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto Advance does not work when "Show answer long-press time" is not zero (default)

1 participant

Comments