Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom buttons zoom twice when tapped slowly #1733

Closed
hauke96 opened this issue Aug 20, 2021 · 3 comments
Closed

Zoom buttons zoom twice when tapped slowly #1733

hauke96 opened this issue Aug 20, 2021 · 3 comments

Comments

@hauke96
Copy link
Contributor

hauke96 commented Aug 20, 2021

Issue Type

[ ] Question
[x] Bug
[ ] Improvement
[ ] Build system related
[ ] Performance
[ ] Documentation

Description and/or steps/code to reproduce the problem

When tapping a zoom button very slowly, there is a zoom in/out happening on the ACTION_DOWN and also on the ACTION_UP event, so there are two zooms happening. This doesn't feel right and also confused an user of an app of mine.

As far as my research goes this is caused by pull request #1471 in the CustomZoomButtonsDisplay by this line. Here both UP and DOWN events are considered a touch which causes the CustomZoomButtonsController to trigger two onZoom() calls on the map controller (see e.g. here).
If this is not a bug, maybe it's better to somehow configure the behavior on the CustomZoomButtonsController class?

Steps to reproduce

  1. Tap and hold on the zoom in/out button
  • Now the map zooms in/out
  1. Wait a second until the animation completed
  2. Release your finger
  • Another zoom happens

Environment

If it's a bug, version(s) of android this affects:

As far as I know all versions of android are affected.

Version of osmdroid the issue relates to:

6.1.8

@monsieurtanuki
Copy link
Collaborator

Hi @hauke96!
It does look like a bug to me.
Feel free to create a PR - I guess ACTION_DOWN would be enough, what do you think?

@hauke96
Copy link
Contributor Author

hauke96 commented Aug 23, 2021

Hi, I think ACTION_UP is better suited as it's the default behavior on normal buttons (on desktop systems as well as on android). I currently have little time so it will take a while until I work on this, but it's on my bucket list.

@monsieurtanuki
Copy link
Collaborator

Fixed by #1775.

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

No branches or pull requests

2 participants