From 75939180068c9eb1de06d0a293bcf3661aba3321 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Fri, 10 Jul 2015 18:15:34 -0700 Subject: [PATCH] fix image button repeating animation incorrectly Closes #3610 // FREEBIE --- .../securesms/components/camera/HidingImageButton.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/components/camera/HidingImageButton.java b/src/org/thoughtcrime/securesms/components/camera/HidingImageButton.java index e07bac37e0..0d2281c1ef 100644 --- a/src/org/thoughtcrime/securesms/components/camera/HidingImageButton.java +++ b/src/org/thoughtcrime/securesms/components/camera/HidingImageButton.java @@ -26,7 +26,7 @@ public class HidingImageButton extends ImageButton { } public void hide() { - if (!isEnabled()) return; + if (!isEnabled() || getVisibility() == GONE) return; final Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.slide_to_right); animation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) {} @@ -39,7 +39,7 @@ public class HidingImageButton extends ImageButton { } public void show() { - if (!isEnabled()) return; + if (!isEnabled() || getVisibility() == VISIBLE) return; setVisibility(VISIBLE); animateWith(AnimationUtils.loadAnimation(getContext(), R.anim.slide_from_right)); }