Skip to content

Fix: Prevent gesture navigation from overriding Previewer Slider #20400

Open
adi09871 wants to merge 1 commit intoankidroid:mainfrom
adi09871:fix-slider-gesture-20397
Open

Fix: Prevent gesture navigation from overriding Previewer Slider #20400
adi09871 wants to merge 1 commit intoankidroid:mainfrom
adi09871:fix-slider-gesture-20397

Conversation

@adi09871
Copy link

@adi09871 adi09871 commented Mar 5, 2026

Purpose / Description

When the slider in the Previewer is in active use, gesture navigation from the edges (swipe to go back) overrides the slider control. This makes it difficult to begin using the slider from the extreme left or right ends, as the system intercepts the touch event.

Fixes

Approach

I added requestDisallowInterceptTouchEvent(true) to the slider's parent view inside onStartTrackingTouch. This prevents the system's edge-to-edge gesture navigation from hijacking the active swipe gesture when the user is interacting with the slider. Once the user releases the slider (onStopTrackingTouch), it is set back to false to restore normal system back-navigation.

How Has This Been Tested?

Tested locally on an Android Emulator (API 34) with Gesture Navigation enabled.

  1. Enabled system gesture navigation.
  2. Added dummy flashcards to a deck to make the slider visible in the Previewer.
  3. Swiped from the extreme left/right edges over the slider.
  4. Verified that the slider moves smoothly and the system back gesture is not triggered while the slider is being held.

(A screen recording demonstrating this fix is attached in the comments below.)

Checklist

Please, go through these checks before submitting the PR.

  • 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

@adi09871
Copy link
Author

adi09871 commented Mar 5, 2026

Screen.Recording.2026-03-05.234059.mp4

Here is the video demonstrating the fix

@ShaanNarendran
Copy link
Contributor

I don't think your video and the issue raised match up. I don't see the slider in the video and the issue targets the fact that users that use the slider may have conflicts with gesture controls.

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.

Previewer: Gesture navigation overrides interacting with the Slider

2 participants