Skip to content

Commit

Permalink
Fixed touch listener area
Browse files Browse the repository at this point in the history
  • Loading branch information
hluhovskyi committed May 25, 2017
1 parent 5b43226 commit e28c285
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Button which is visible while user holds it. Main use case is controlling audio
Add library as dependency to your `build.gradle`.

```
compile 'com.dewarder:holdingbutton:0.0.8'
compile 'com.dewarder:holdingbutton:0.0.9'
```

## How to use
Expand Down
4 changes: 2 additions & 2 deletions holdingbutton/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

ext {
artifactVersion = '0.0.8'
artifactVersion = '0.0.9'
artifactName = 'holdingbutton'
siteUrl = 'https://github.com/dewarder/HoldingButton'
gitUrl = 'https://github.com/dewarder/HoldingButton.git'
Expand Down Expand Up @@ -110,7 +110,7 @@ bintray {
vcsUrl = gitUrl
version {
name = artifactVersion
desc = 'Add ability to intercept expanding animation'
desc = 'Fixed touch listener area'
released = new Date()
vcsTag = "$artifactVersion"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -180,7 +179,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
final int action = ev.getActionMasked();
switch (action) {
case MotionEvent.ACTION_DOWN: {
return isButtonEnabled() && shouldInterceptAnimation() && isViewTouched(mHoldingView, ev);
return isButtonEnabled() && isViewTouched(mHoldingView, ev);
}
}

Expand All @@ -193,7 +192,7 @@ public boolean onTouchEvent(MotionEvent event) {

switch (action) {
case MotionEvent.ACTION_DOWN: {
if (isButtonEnabled() && shouldInterceptAnimation() && isViewTouched(mHoldingView, event)) {
if (isButtonEnabled() && isViewTouched(mHoldingView, event) && shouldInterceptAnimation()) {
mHoldingView.getLocationInWindow(mHoldingViewLocation);
getLocationInWindow(mViewLocation);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import com.dewarder.holdinglibrary.HoldingButtonLayout;
import com.dewarder.holdinglibrary.HoldingButtonLayoutListener;
import com.dewarder.holdinglibrary.HoldingButtonTouchListener;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
Expand Down

0 comments on commit e28c285

Please sign in to comment.