diff options
author | George Hilliard <gh403@msstate.edu> | 2015-01-21 11:08:53 -0600 |
---|---|---|
committer | George Hilliard <gh403@msstate.edu> | 2015-01-21 11:30:01 -0600 |
commit | 8df84539976799d648075eb22ebb95a3a764e1db (patch) | |
tree | 3c2f94ca12800f7a81d55419b4f9f77952d7bdf0 | |
parent | 5bc1456c7b963479aa04f58fdc5314de948760ad (diff) | |
download | android_packages_apps_ContactsCommon-8df84539976799d648075eb22ebb95a3a764e1db.tar.gz android_packages_apps_ContactsCommon-8df84539976799d648075eb22ebb95a3a764e1db.tar.bz2 android_packages_apps_ContactsCommon-8df84539976799d648075eb22ebb95a3a764e1db.zip |
Add overloads to scaleIn() and scaleOut() to receive an AnimationCallback
Change-Id: Ib3dfba712b43c684534682bbc98e42743b851d6b
-rw-r--r-- | src/com/android/contacts/common/widget/FloatingActionButtonController.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/contacts/common/widget/FloatingActionButtonController.java b/src/com/android/contacts/common/widget/FloatingActionButtonController.java index 679eb7b4..15d68594 100644 --- a/src/com/android/contacts/common/widget/FloatingActionButtonController.java +++ b/src/com/android/contacts/common/widget/FloatingActionButtonController.java @@ -25,6 +25,7 @@ import android.view.View; import com.android.contacts.common.util.ViewUtil; import com.android.contacts.common.R; import com.android.phone.common.animation.AnimUtils; +import com.android.phone.common.animation.AnimUtils.AnimationCallback; /** * Controls the movement and appearance of the FAB (Floating Action Button). @@ -142,8 +143,12 @@ public class FloatingActionButtonController { * @param delayMs The delay for the effect, in milliseconds. */ public void scaleIn(int delayMs) { + scaleIn(delayMs, null); + } + + public void scaleIn(int delayMs, AnimationCallback callback) { setVisible(true); - AnimUtils.scaleIn(mFloatingActionButtonContainer, FAB_SCALE_IN_DURATION, delayMs); + AnimUtils.scaleIn(mFloatingActionButtonContainer, FAB_SCALE_IN_DURATION, delayMs, callback); AnimUtils.fadeIn(mFloatingActionButton, FAB_SCALE_IN_DURATION, delayMs + FAB_SCALE_IN_FADE_IN_DELAY, null); } @@ -153,10 +158,14 @@ public class FloatingActionButtonController { * an animation for hiding the floating action button. */ public void scaleOut() { - AnimUtils.scaleOut(mFloatingActionButtonContainer, mAnimationDuration); + scaleOut(null); + } + + public void scaleOut(AnimationCallback callback) { + AnimUtils.scaleOut(mFloatingActionButtonContainer, mAnimationDuration, callback); // Fade out the icon faster than the scale out animation, so that the icon scaling is less // obvious. We don't want it to scale, but the resizing the container is not as performant. - AnimUtils.fadeOut(mFloatingActionButton, FAB_ICON_FADE_OUT_DURATION, null); + AnimUtils.fadeOut(mFloatingActionButton, FAB_ICON_FADE_OUT_DURATION); } /** |