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
Conversation
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Refinements for interacting with map in routing mode
Closes #74