-
Notifications
You must be signed in to change notification settings - Fork 642
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
Set view as empty with double tap #91
base: master
Are you sure you want to change the base?
Conversation
Updated the "mIsEmpty" flag once the user double taps the signature pad.
@@ -208,7 +208,10 @@ public boolean onTouchEvent(MotionEvent event) { | |||
case MotionEvent.ACTION_DOWN: | |||
getParent().requestDisallowInterceptTouchEvent(true); | |||
mPoints.clear(); | |||
if (isDoubleClick()) break; | |||
if (isDoubleClick()) { |
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.
Can you extract from the function isDoubleClick()
the part where the signature is cleared, so we can have the clearing part and the setIsEmpty(true)
in the same place? I'd like to have isDoubleClick()
as immutable method.
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.
Sure. Can you take a look at the new commit to check if that's what you wanted?
Removed `this.clearView();` from the `isDoubleClick()` method. It's now placed inside `onTouchEvent()` if the `isDoubleClick()` condition is `true`.
I've tested it, and it's not working as it should yet because this line keeps resetting the variable. |
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.
Not working.
Fix #91
Updated the
mIsEmpty
flag once the user double taps the signature pad.Previous to this modification, if the user signed the view, and double tapped, the method
isEmpty()
would always returnfalse
.