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

Set view as empty with double tap #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Mauker1
Copy link

@Mauker1 Mauker1 commented Jul 25, 2017

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 return false.

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()) {
Copy link
Owner

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.

Copy link
Author

@Mauker1 Mauker1 Sep 26, 2017

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`.
@Mauker1
Copy link
Author

Mauker1 commented Sep 28, 2017

I've tested it, and it's not working as it should yet because this line keeps resetting the variable.

Copy link

@Aks-4125 Aks-4125 left a comment

Choose a reason for hiding this comment

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

Not working.

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.

3 participants