Skip to content

Conversation

@DominikTulak
Copy link

Root Cause of the Issue

Previously, there was an incorrect if statement that only checked whether there was any movement (delta != 0) in the horizontal direction. This did not accurately distinguish between swipe gestures and taps.

Description of Change

I have fixed the if statement that handles the initial touch interaction. I updated the check to determine whether the user's movement was more horizontal than vertical, and whether it exceeded the minimum threshold required to be considered a swipe. Additionally, I introduced a control variable _shouldProcessTouchForSwipe, which is now checked in ITouchListener.OnTouch event. If _shouldProcessTouchForSwipe is false, the method returns early, preventing the touch from being processed as a swipe.

Issues Fixed

Clicking on Android 15 and newer now works as expected. Even if I move my finger a little while tapping, the click is registered.

Fixes #304

Copilot AI review requested due to automatic review settings December 5, 2025 14:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes touch interception logic in the TabView component for Android 15+ by improving how the system distinguishes between tap gestures and horizontal swipe gestures. The fix prevents false positive swipe detection when users tap with slight finger movement.

Key Changes:

  • Introduced a control flag _shouldProcessTouchForSwipe to track when touches should be processed as swipes
  • Updated touch detection logic to require horizontal movement exceeding a threshold AND being greater than vertical movement
  • Added early return in ITouchListener.OnTouch to prevent processing non-swipe touches

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

SFTabView: EnableSwiping option makes tapping difficult on Android 15+

1 participant