-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add display option for map zoom buttons #630
Comments
Looking into adding this feature. Please bear with me as I'm a new contributor to the android open source community. Would it be acceptable to add checkbox preference to show and hide the zoom buttons? |
Welcome @matty-23! No worries, newcomers are always welcome. Yes, I'd add a CheckboxPreference under the "Display" category that defaults to off, and when checked it shows the zoom control. IIRC you should just be able to add some code in BaseMapFragment.onResume() in the The main tricky part for this is making sure that the other views that slide on top of the map (e.g., when showing route on map, when tapping on stop on map) don't cover the zoom control when it's enabled. I think this is already implemented, but it would be the first thing to check when you have a working implementation. Also, feel free to open a work in progress PR and continue to push commits to the branch as you go. It makes it easier to provide feedback along the way. |
Setting Edit: I was able to add padding to move the controls to the left. Refer to this commit. To get around this, I could:
First option makes the function visible to the user, but there can be issues with the other map layers covering the buttons as @barbeau mentioned in the previous post. Second option doesn't add additional views the UI but we will have to make a decision on whether to disable volume control when the zoom controls are enabled. Any thoughts on which is preferable? |
Hmmm...ideally we'd be able to move the default zoom control to the bottom left corner (and when "Left hand mode" is enabled, swap to bottom right corner), but I think doing that by setting the map padding would result in strange behavior. It looks like you can reference the internal view IDs to move the default zoom control: ...but that's not officially supported and could break at any time if the So, it seems like the best solution would be to implement custom zoom buttons that look and behave exactly like the default zoom controls, but are aligned to the left instead of right. I believe |
* Based on commit 7aa3783 - Fix OneBusAway#630 - Add map zoom control with checkbox preference in settings (OneBusAway#867)
Summary:
User feedback:
As a workaround, you can double-tap on the map, but on the 2nd tap hold on the screen, and then drag your thumb on the screen. It should zoom in and out.
For users that prefer buttons, it should be fairly simple to just add a display option to add them.
The text was updated successfully, but these errors were encountered: