diff --git a/.idea/modules.xml b/.idea/modules.xml index 078c317..13d2068 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,9 @@ + + diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index 34b1442..1b2a40d 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -29,7 +29,7 @@ app:button_top_padding="20dp" app:button_bottom_padding="20dp" app:button_background="@drawable/shape_button" - app:initial_state="enabled" + app:initial_state="disabled" /> diff --git a/swipe-button/build.gradle b/swipe-button/build.gradle index 3afd524..317f381 100644 --- a/swipe-button/build.gradle +++ b/swipe-button/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.jfrog.bintray' apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'gnag' -version = '0.4.2' +version = '0.5.0' group = 'com.ebanx' android { @@ -103,7 +103,7 @@ install { packaging 'aar' groupId 'com.ebanx' artifactId 'swipe-button' - version '0.4.2' + version '0.5.0' licenses { license { diff --git a/swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java b/swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java index 70b734e..29c2d26 100644 --- a/swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java +++ b/swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java @@ -31,7 +31,6 @@ public class SwipeButton extends RelativeLayout { private ImageView swipeButton; private float initialX; private boolean active; - private int initialButtonWidth; private TextView centerText; private ViewGroup background; @@ -270,7 +269,6 @@ public boolean onTouch(View v, MotionEvent event) { collapseButton(); } else { if (swipeButton.getX() + swipeButton.getWidth() > getWidth() * 0.85) { - initialButtonWidth = swipeButton.getWidth(); expandButton(); } else { moveButtonBack(); @@ -355,7 +353,7 @@ public void onAnimationUpdate(ValueAnimator animation) { private void collapseButton() { final ValueAnimator widthAnimator = ValueAnimator.ofInt( swipeButton.getWidth(), - initialButtonWidth); + swipeButton.getHeight()); widthAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override