Merge "Hide the floating toolbar faster." into mnc-dev

This commit is contained in:
Abodunrinwa Toki
2015-05-18 17:12:18 +00:00
committed by Android (Google) Code Review

View File

@@ -357,6 +357,7 @@ public final class FloatingToolbar {
mShowAnimation = createGrowFadeInFromBottom(mContentContainer);
mDismissAnimation = createShrinkFadeOutFromBottomAnimation(
mContentContainer,
0,
new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -366,6 +367,7 @@ public final class FloatingToolbar {
});
mHideAnimation = createShrinkFadeOutFromBottomAnimation(
mContentContainer,
150,
new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -1263,15 +1265,16 @@ public final class FloatingToolbar {
* Creates a "shrink and fade out from bottom" 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(
View view, Animator.AnimatorListener listener) {
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(150);
shrinkFadeOutFromBottomAnimation.setStartDelay(startDelay);
shrinkFadeOutFromBottomAnimation.addListener(listener);
return shrinkFadeOutFromBottomAnimation;
}