-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Decrease swipe sensitivity for hint overlay #12596
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
Conversation
…imorAnimationFixes
…imorAnimationFixes
…imorAnimationFixes
…essSensitiveSwipe
| gestures.onGesture(SwipeXYRecognizer, e => { | ||
| const xSwipe = Math.abs(e.data.deltaX); | ||
| const ySwipe = Math.abs(e.data.deltaY); | ||
| const minSwipeDelta = 50; |
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.
Should be a top-level-constant, MIN_SWIPE_FOR_HINT_OVERLAY_PX = 50.
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.
Done
| gestures.onGesture(SwipeXYRecognizer, () => { | ||
| if (this.bookend_.isActive()) { | ||
| gestures.onGesture(SwipeXYRecognizer, e => { | ||
| const xSwipe = Math.abs(e.data.deltaX); |
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.
- Refactor into boolean method.
- Make short-circuit clauses independent.
if (this.bookend_.isActive()) {
return;
}
if (!isSwipeLargeEnoughForHint_(e.data.deltaX, e.data.deltaY)) {
return;
}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.
Done
| const xSwipe = Math.abs(e.data.deltaX); | ||
| const ySwipe = Math.abs(e.data.deltaY); | ||
| const minSwipeDelta = 50; | ||
| const canShowEducationOverlay = |
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.
Avoid the word education as the current terminology is hint.
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.
this is remove
| const ySwipe = Math.abs(e.data.deltaY); | ||
| const minSwipeDelta = 50; | ||
| const canShowEducationOverlay = | ||
| xSwipe > minSwipeDelta || ySwipe > minSwipeDelta; |
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.
This is inaccurate, you should calculate line distance:
Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2))
> MIN_SWIPE_FOR_HINT_OVERLAY_PXThere 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.
oh yeah... makes sense
Adds a threshold to swipe before education system is triggered