From e28c28597026fbc85e04cc5b6a463d0165ca47c1 Mon Sep 17 00:00:00 2001 From: dewarder Date: Thu, 25 May 2017 13:01:03 +0300 Subject: [PATCH] Fixed touch listener area --- README.md | 2 +- holdingbutton/build.gradle | 4 ++-- .../com/dewarder/holdinglibrary/HoldingButtonLayout.java | 5 ++--- .../java/com/dewarder/holdingbuttonsample/MainActivity.java | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b2095c9..fc2b0bf 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/holdingbutton/build.gradle b/holdingbutton/build.gradle index d0f5434..9305508 100644 --- a/holdingbutton/build.gradle +++ b/holdingbutton/build.gradle @@ -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' @@ -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" } diff --git a/holdingbutton/src/main/java/com/dewarder/holdinglibrary/HoldingButtonLayout.java b/holdingbutton/src/main/java/com/dewarder/holdinglibrary/HoldingButtonLayout.java index 5e75e8c..cd1dbc0 100644 --- a/holdingbutton/src/main/java/com/dewarder/holdinglibrary/HoldingButtonLayout.java +++ b/holdingbutton/src/main/java/com/dewarder/holdinglibrary/HoldingButtonLayout.java @@ -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; @@ -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); } } @@ -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); diff --git a/holdingbuttonsample/src/main/java/com/dewarder/holdingbuttonsample/MainActivity.java b/holdingbuttonsample/src/main/java/com/dewarder/holdingbuttonsample/MainActivity.java index 2b3e99d..d11180f 100644 --- a/holdingbuttonsample/src/main/java/com/dewarder/holdingbuttonsample/MainActivity.java +++ b/holdingbuttonsample/src/main/java/com/dewarder/holdingbuttonsample/MainActivity.java @@ -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;