Skip to content

fix: make pinch-to-zoom work again after adding edge gestures#965

Draft
schembriaiden wants to merge 1 commit intoDonutWare:developfrom
schembriaiden:fix/pinch-to-zoom
Draft

fix: make pinch-to-zoom work again after adding edge gestures#965
schembriaiden wants to merge 1 commit intoDonutWare:developfrom
schembriaiden:fix/pinch-to-zoom

Conversation

@schembriaiden
Copy link
Copy Markdown
Contributor

Pull Request Description

This pull request updates the touch gesture handling for vertical drag actions in the video player controls. The main improvement is to restrict vertical drag gestures for brightness and volume to the left and right edges of the screen, reducing accidental activations and aligning with common video player UX patterns.

Touch gesture improvements:

  • Vertical drag gestures for brightness and volume are now only detected in dedicated left and right edge zones, each occupying 15% of the screen width and 80% of the height, instead of anywhere on the screen. This change helps avoid accidental triggers and provides a more intuitive user experience. (lib/screens/video_player/video_player_controls.dart)
  • The _handleVerticalDragStart method now takes an explicit isLeft parameter, determined by which edge zone the gesture started in, rather than calculating the side based on the touch position. This makes the logic clearer and more maintainable. (lib/screens/video_player/video_player_controls.dart)

Issue Being Fixed

After the last update I noticed an issue where the pinch-to-zoom was a bit inconsistent due to the new edge gestures I added, this update aims to fix that by making the edge gestures take up only the 15% edges of the screen and the middle is saved for the pinch to zoom. Before it was a 50/50 split for the edge gestures, which was a bit shortsighted from my end.

Screenshots / Recordings

Tested On

  • Android
  • Android TV
  • iOS
  • Linux
  • Windows
  • macOS
  • Web

Checklist

  • If a new package was added, did you ensure it works for all supported platforms? Is the package well maintained
  • Check that any changes are related to the issue at hand.

@schembriaiden schembriaiden changed the title fix: make pinch-to-zoom work again after edge gestures fix: make pinch-to-zoom work again after adding edge gestures Apr 18, 2026
heightFactor: 0.8,
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onVerticalDragStart: (details) => _handleVerticalDragStart(details, isLeft: true),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems very hacky to have two GestureDetectors.

We should be able to infer the location of the drag using the DragStartDetails

@schembriaiden schembriaiden marked this pull request as draft April 29, 2026 10:04
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.

2 participants