From b81feab9ac1741c9c2ce6f953df4c6681f4cb828 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 27 Mar 2016 08:14:30 +0300 Subject: [PATCH 1/2] fix anumation --- .../audiorecorder/animations/StepAnimation.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/github/axet/audiorecorder/animations/StepAnimation.java b/app/src/main/java/com/github/axet/audiorecorder/animations/StepAnimation.java index 5e80e29..d7c522d 100644 --- a/app/src/main/java/com/github/axet/audiorecorder/animations/StepAnimation.java +++ b/app/src/main/java/com/github/axet/audiorecorder/animations/StepAnimation.java @@ -2,9 +2,7 @@ package com.github.axet.audiorecorder.animations; import android.util.Log; import android.view.View; -import android.view.ViewGroup; import android.view.animation.Animation; -import android.view.animation.AnimationSet; import android.view.animation.AnimationUtils; import android.view.animation.Transformation; @@ -28,8 +26,8 @@ public class StepAnimation extends Animation { if (animate) { if (m.hasEnded()) { - if ((expand && v.getVisibility() == View.GONE) || (!expand && v.getVisibility() == View.VISIBLE)) { - StepAnimation mm = c.create(); + StepAnimation mm = c.create(); + if (mm.animationReady()) { mm.startAnimation(v); } else { // do nothing, already visible view @@ -54,7 +52,8 @@ public class StepAnimation extends Animation { } else { StepAnimation mm = c.create(); if (animate) { - if ((expand && v.getVisibility() == View.GONE) || (!expand && v.getVisibility() == View.VISIBLE)) { + Log.d("123", "new " + expand + " " + mm.view.getVisibility()); + if (mm.animationReady()) { mm.startAnimation(v); } else { // do nothing. already visible @@ -71,6 +70,11 @@ public class StepAnimation extends Animation { this.expand = expand; } + // start animation only if view in proper visible state. gone for expanding, and visible for collapsing. + public boolean animationReady() { + return (expand && view.getVisibility() == View.GONE) || (!expand && view.getVisibility() == View.VISIBLE); + } + public void startAnimation(View v) { init(); // do first step to hide view (we animation does it). From 75fee20d7a9c69e77438f3f8b123b9072832861b Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Sun, 27 Mar 2016 08:14:32 +0300 Subject: [PATCH 2/2] Bump version 1.1.14 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 39592cf..e1e8e04 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.github.axet.audiorecorder" minSdkVersion 16 targetSdkVersion 23 - versionCode 34 - versionName "1.1.13" + versionCode 35 + versionName "1.1.14" } signingConfigs { release {