Merge "Follow ContactsContract API changes" into lmp-dev
diff --git a/src/com/android/contacts/common/CallUtil.java b/src/com/android/contacts/common/CallUtil.java
index ea53571..307c975 100644
--- a/src/com/android/contacts/common/CallUtil.java
+++ b/src/com/android/contacts/common/CallUtil.java
@@ -36,6 +36,7 @@
     public static final String SCHEME_MAILTO = "mailto";
     public static final String SCHEME_IMTO = "imto";
     public static final String SCHEME_SIP = "sip";
+    public static final String SCHEME_VOICEMAIL = "voicemail";
 
     /**
      * Return an Intent for making a phone call. Scheme (e.g. tel, sip) will be determined
diff --git a/src/com/android/contacts/common/widget/FloatingActionButtonController.java b/src/com/android/contacts/common/widget/FloatingActionButtonController.java
index 773e024..679eb7b 100644
--- a/src/com/android/contacts/common/widget/FloatingActionButtonController.java
+++ b/src/com/android/contacts/common/widget/FloatingActionButtonController.java
@@ -34,8 +34,9 @@
     public static final int ALIGN_QUARTER_END = 1;
     public static final int ALIGN_END = 2;
 
-    private static final int FAB_FADE_DURATION = 266;
-    private static final int FAB_FADE_IN_DELAY = 100;
+    private static final int FAB_SCALE_IN_DURATION = 266;
+    private static final int FAB_SCALE_IN_FADE_IN_DELAY = 100;
+    private static final int FAB_ICON_FADE_OUT_DURATION = 66;
 
     private final int mAnimationDuration;
     private final int mFloatingActionButtonWidth;
@@ -138,10 +139,13 @@
     /**
      * Scales the floating action button from no height and width to its actual dimensions. This is
      * an animation for showing the floating action button.
+     * @param delayMs The delay for the effect, in milliseconds.
      */
-    public void scaleIn() {
-        AnimUtils.scaleIn(mFloatingActionButtonContainer, mAnimationDuration);
-        AnimUtils.fadeIn(mFloatingActionButton, FAB_FADE_DURATION, FAB_FADE_IN_DELAY, null);
+    public void scaleIn(int delayMs) {
+        setVisible(true);
+        AnimUtils.scaleIn(mFloatingActionButtonContainer, FAB_SCALE_IN_DURATION, delayMs);
+        AnimUtils.fadeIn(mFloatingActionButton, FAB_SCALE_IN_DURATION,
+                delayMs + FAB_SCALE_IN_FADE_IN_DELAY, null);
     }
 
     /**
@@ -150,6 +154,9 @@
      */
     public void scaleOut() {
         AnimUtils.scaleOut(mFloatingActionButtonContainer, mAnimationDuration);
+        // 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);
     }
 
     /**
@@ -182,17 +189,6 @@
         return result;
     }
 
-    /**
-     * Manually translates the FAB without animation.
-     *
-     * @param translationX The x distance to translate.
-     * @param translationY The y distance to translate.
-     */
-    public void manuallyTranslate(int translationX, int translationY) {
-        mFloatingActionButtonContainer.setTranslationX(translationX);
-        mFloatingActionButtonContainer.setTranslationY(translationY);
-    }
-
     private boolean isLayoutRtl() {
         return mFloatingActionButtonContainer.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
     }