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

Refinements for interacting with map in routing mode #194

Merged
merged 2 commits into from Dec 11, 2015

Conversation

ecgreb
Copy link
Collaborator

@ecgreb ecgreb commented Dec 11, 2015

  • Track user swipe on view pager vs. programatic changes
  • Do not show resume button unless map is moved minimum distance by user
  • Do not reset map position to current instruction while user is panning the map

Closes #74

Verify map is moved a minimum distance before triggering resume button show. Do not show on other motion events.
When the user is manually interacting with the map using gestures it should not automatically snap to the current instruction on pager advance. However it should still snap to the current instruction when the user swipes the view pager.

This is achieved by tracking the scroll state of the pager to distinguish changes due to user swipe vs. programatic changes.
@@ -6,13 +6,17 @@ import com.mapzen.valhalla.Instruction
import com.mapzen.valhalla.Route

public interface RoutePresenter {
companion object {
public val GESTURE_MIN_DELTA = 0.0001f
Copy link
Member

Choose a reason for hiding this comment

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

How did you arrive at this number?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Its an arbitrary pixel value to make sure the user is actually trying to drag the map rather than perform another type of gesture.

Copy link
Member

Choose a reason for hiding this comment

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

Is certain hardware able to track sub-pixel motion gestures? I hadn't heard of that. Just wondering if it needs to be that fine or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I'm not certain but [MotionEvent.html#getHistoricalX(int, int)](https://developer.android.com/reference/android/view/MotionEvent.html#getHistoricalX%28int, int%29) does return a float so I'm guessing its within the realm of posibility.

Copy link
Member

Choose a reason for hiding this comment

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

Alrighty. Can always tweak later if we figure out something.

msmollin added a commit that referenced this pull request Dec 11, 2015
Refinements for interacting with map in routing mode
@msmollin msmollin merged commit 3248e89 into master Dec 11, 2015
@msmollin msmollin deleted the 74-snapping-while-panning branch December 11, 2015 21:35
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.

None yet

2 participants