summaryrefslogtreecommitdiffstats
path: root/core/java/com/android/internal/widget/FloatingToolbar.java
diff options
context:
space:
mode:
authorAbodunrinwa Toki <toki@google.com>2015-06-03 21:33:15 +0100
committerAbodunrinwa Toki <toki@google.com>2015-06-10 13:45:25 +0100
commit7aa6d0a4b1ec7f75335348a86284d3773cc72f91 (patch)
tree8dd1d398ae4a6e91d1e294028588140827a10e2f /core/java/com/android/internal/widget/FloatingToolbar.java
parentda9bbf725592c6482d6fbce18ef8c258b18e4fc8 (diff)
downloadframeworks_base-7aa6d0a4b1ec7f75335348a86284d3773cc72f91.zip
frameworks_base-7aa6d0a4b1ec7f75335348a86284d3773cc72f91.tar.gz
frameworks_base-7aa6d0a4b1ec7f75335348a86284d3773cc72f91.tar.bz2
Change FloatingToolbar entry/exit animations to fadeIn/fadeOut.
Bug: 21307167 Change-Id: I7f75e064c264666ad0e8f84d5421fcc15176ee3f
Diffstat (limited to 'core/java/com/android/internal/widget/FloatingToolbar.java')
-rw-r--r--core/java/com/android/internal/widget/FloatingToolbar.java39
1 files changed, 18 insertions, 21 deletions
diff --git a/core/java/com/android/internal/widget/FloatingToolbar.java b/core/java/com/android/internal/widget/FloatingToolbar.java
index c77d614..2d0989f 100644
--- a/core/java/com/android/internal/widget/FloatingToolbar.java
+++ b/core/java/com/android/internal/widget/FloatingToolbar.java
@@ -361,7 +361,7 @@ public final class FloatingToolbar {
mParent = Preconditions.checkNotNull(parent);
mContentContainer = createContentContainer(parent.getContext());
mPopupWindow = createPopupWindow(mContentContainer);
- mDismissAnimation = createShrinkFadeOutFromBottomAnimation(
+ mDismissAnimation = createExitAnimation(
mContentContainer,
150, // startDelay
new AnimatorListenerAdapter() {
@@ -371,7 +371,7 @@ public final class FloatingToolbar {
mContentContainer.removeAllViews();
}
});
- mHideAnimation = createShrinkFadeOutFromBottomAnimation(
+ mHideAnimation = createExitAnimation(
mContentContainer,
0, // startDelay
new AnimatorListenerAdapter() {
@@ -561,7 +561,7 @@ public final class FloatingToolbar {
* Performs the "show" animation on the floating popup.
*/
private void runShowAnimation() {
- createGrowFadeInFromBottom(mContentContainer).start();
+ createEnterAnimation(mContentContainer).start();
}
/**
@@ -1369,38 +1369,35 @@ public final class FloatingToolbar {
}
/**
- * Creates a "grow and fade in from the bottom" animation for the specified view.
+ * Creates an "appear" animation for the specified view.
*
* @param view The view to animate
*/
- private static AnimatorSet createGrowFadeInFromBottom(View view) {
- AnimatorSet growFadeInFromBottomAnimation = new AnimatorSet();
- growFadeInFromBottomAnimation.playTogether(
- ObjectAnimator.ofFloat(view, View.SCALE_X, 0.5f, 1).setDuration(125),
- ObjectAnimator.ofFloat(view, View.SCALE_Y, 0.5f, 1).setDuration(125),
- ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1).setDuration(75),
+ private static AnimatorSet createEnterAnimation(View view) {
+ AnimatorSet animation = new AnimatorSet();
+ animation.playTogether(
+ ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1).setDuration(200),
// Make sure that view.x is always fixed throughout the duration of this animation.
ObjectAnimator.ofFloat(view, View.X, view.getX(), view.getX()));
- growFadeInFromBottomAnimation.setStartDelay(50);
- return growFadeInFromBottomAnimation;
+ animation.setStartDelay(50);
+ return animation;
}
/**
- * Creates a "shrink and fade out from bottom" animation for the specified view.
+ * Creates a "disappear" animation for the specified view.
*
* @param view The view to animate
* @param startDelay The start delay of the animation
* @param listener The animation listener
*/
- private static AnimatorSet createShrinkFadeOutFromBottomAnimation(
+ private static AnimatorSet createExitAnimation(
View view, int startDelay, Animator.AnimatorListener listener) {
- AnimatorSet shrinkFadeOutFromBottomAnimation = new AnimatorSet();
- shrinkFadeOutFromBottomAnimation.playTogether(
- ObjectAnimator.ofFloat(view, View.SCALE_Y, 1, 0.5f).setDuration(125),
- ObjectAnimator.ofFloat(view, View.ALPHA, 1, 0).setDuration(75));
- shrinkFadeOutFromBottomAnimation.setStartDelay(startDelay);
- shrinkFadeOutFromBottomAnimation.addListener(listener);
- return shrinkFadeOutFromBottomAnimation;
+ AnimatorSet animation = new AnimatorSet();
+ animation.playTogether(
+ ObjectAnimator.ofFloat(view, View.ALPHA, 1, 0).setDuration(200));
+ animation.setStartDelay(startDelay);
+ animation.addListener(listener);
+ return animation;
}
private static int getEstimatedToolbarHeight(Context context) {