summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorGeorge Hilliard <gh403@msstate.edu>2015-01-21 11:08:53 -0600
committerSteve Kondik <steve@cyngn.com>2015-03-22 15:03:04 -0700
commit3ee531c0f3e9a616ea8c4f7addd96e751f9df061 (patch)
treebd4f8beba2b6ec87b9d86e43aa71e41823a2f03b /src/com
parentc43df94094a0b7d3a8c613a6bf8220f34e5fc85f (diff)
downloadandroid_packages_apps_ContactsCommon-3ee531c0f3e9a616ea8c4f7addd96e751f9df061.tar.gz
android_packages_apps_ContactsCommon-3ee531c0f3e9a616ea8c4f7addd96e751f9df061.tar.bz2
android_packages_apps_ContactsCommon-3ee531c0f3e9a616ea8c4f7addd96e751f9df061.zip
Add overloads to scaleIn() and scaleOut() to receive an AnimationCallback
Change-Id: Ib3dfba712b43c684534682bbc98e42743b851d6b
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/contacts/common/widget/FloatingActionButtonController.java15
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);
}
/**