Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mobile: Keep selection on tap and hold#6208

Draft
MaxGyver83 wants to merge 1 commit into
fyne-io:developfrom
MaxGyver83:mobile-keep-selection-on-tap-and-hold
Draft

mobile: Keep selection on tap and hold#6208
MaxGyver83 wants to merge 1 commit into
fyne-io:developfrom
MaxGyver83:mobile-keep-selection-on-tap-and-hold

Conversation

@MaxGyver83
Copy link
Copy Markdown
Contributor

Description:

With this PR, a click happens only after the finger is released because at the moment of touching the screen, you can't know if the user is going to perform a regular (short) or a secondary (long) tap.

I'm still unsure if this breaks anything. At least the demo app seems to behave normal when compiled with -tags=mobile.

Fixes #6207.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

  • Public APIs match existing style and have Since: line.
  • Any breaking changes have a deprecation path or have been discussed.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 60.664% (-0.06%) from 60.723%
when pulling e7a762a on MaxGyver83:mobile-keep-selection-on-tap-and-hold
into d227d9d on fyne-io:develop.

Copy link
Copy Markdown
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

I haven't run the code but it looks like this removes reporting of the mobile "TouchDown". That is not connected to the Tapped handler and must go to any widget interested.

@MaxGyver83
Copy link
Copy Markdown
Contributor Author

I haven't run the code but it looks like this removes reporting of the mobile "TouchDown". That is not connected to the Tapped handler and must go to any widget interested.

It's true: TouchDown and TouchUp aren't called anymore.

I think, there are two solutions to the problem in the description:

  1. canvas never calls TouchDown and TouchUp and we rely only on the "event interpretations" Tapped, DoubleTapped, and TappedSecondary (and Dragged/DragEnd) (as in this PR; of course there would be more work to do).
  2. The widgets just don't do anything in TouchDown and TouchUp (at least for mobile).

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.

3 participants