Skip to content

Don't register click when user moves away from Button before lifting finger#15

Merged
StevenDXC merged 2 commits into
StevenDXC:masterfrom
Seylox:master
Jan 6, 2018
Merged

Don't register click when user moves away from Button before lifting finger#15
StevenDXC merged 2 commits into
StevenDXC:masterfrom
Seylox:master

Conversation

@Seylox

@Seylox Seylox commented Nov 22, 2017

Copy link
Copy Markdown
Contributor

No description provided.

@lissy93

lissy93 commented Dec 17, 2017

Copy link
Copy Markdown
Contributor

+1 this PR. @StevenDXC any chance of a code review and merge?

@Seylox

Seylox commented Dec 17, 2017

Copy link
Copy Markdown
Contributor Author

@lissy93 if you want to use it with the Changes of the PR you can use it as a dependency from my Repo using Jitpack.io: https://jitpack.io/#Seylox/dxloadingbutton

@leoFengCT

Copy link
Copy Markdown

Touch Event did not add ACTION_CANCEL. It is not work well if touch and then move

public boolean onTouchEvent(MotionEvent event) {
if(!isEnabled()){
return true;
}
Log.i("AAA","Action="+event.getAction()) ;
switch (event.getAction()){
case MotionEvent.ACTION_DOWN:
mTouchX = event.getX();
mTouchY = event.getY();
playRippleAnimation(true,false);
break;
case MotionEvent.ACTION_UP:
playRippleAnimation(false,false);
break;
case MotionEvent.ACTION_CANCEL:
playRippleAnimation(false,true);
break;
}

    return true;
}

@StevenDXC StevenDXC merged commit abb2deb into StevenDXC:master Jan 6, 2018
@StevenDXC

Copy link
Copy Markdown
Owner

thanks, has merged @Seylox

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.

4 participants