diff options
| author | 2010-12-17 16:07:20 -0800 | |
|---|---|---|
| committer | 2010-12-17 16:07:20 -0800 | |
| commit | 73e371ff7a23d814c0da10edf40a5a4f31b26b33 (patch) | |
| tree | a1bb69b53d765aa50db5b241dc02774447aee0a6 | |
| parent | 7d179eebca8e7052df22b9ab269155d91b4f5f20 (diff) | |
Tweak action bar show/hide animations
Change-Id: I69a7b0f84b36ef6f22cc03036daab7e54e1ab74e
| -rw-r--r-- | core/java/com/android/internal/app/ActionBarImpl.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java index 3a58867a84ad..633bdd35be4c 100644 --- a/core/java/com/android/internal/app/ActionBarImpl.java +++ b/core/java/com/android/internal/app/ActionBarImpl.java @@ -505,12 +505,13 @@ public class ActionBarImpl extends ActionBar { } mContainerView.setVisibility(View.VISIBLE); mContainerView.setAlpha(0); - mContainerView.setTranslationY(-mContainerView.getHeight()); AnimatorSet anim = new AnimatorSet(); - AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mContainerView, "translationY", 0)) - .with(ObjectAnimator.ofFloat(mContainerView, "alpha", 1)); + AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mContainerView, "alpha", 1)); if (mContentView != null) { - b.with(ObjectAnimator.ofFloat(mContentView, "translationY", -mContainerView.getHeight(), 0)); + b.with(ObjectAnimator.ofFloat(mContentView, "translationY", + -mContainerView.getHeight(), 0)); + mContainerView.setTranslationY(-mContainerView.getHeight()); + b.with(ObjectAnimator.ofFloat(mContainerView, "translationY", 0)); } anim.addListener(mShowListener); mCurrentAnim = anim; @@ -527,11 +528,12 @@ public class ActionBarImpl extends ActionBar { } mContainerView.setAlpha(1); AnimatorSet anim = new AnimatorSet(); - AnimatorSet.Builder b = anim.play( - ObjectAnimator.ofFloat(mContainerView, "translationY", -mContainerView.getHeight())) - .with(ObjectAnimator.ofFloat(mContainerView, "alpha", 0)); + AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mContainerView, "alpha", 0)); if (mContentView != null) { - b.with(ObjectAnimator.ofFloat(mContentView, "translationY", 0, -mContainerView.getHeight())); + b.with(ObjectAnimator.ofFloat(mContentView, "translationY", + 0, -mContainerView.getHeight())); + b.with(ObjectAnimator.ofFloat(mContainerView, "translationY", + -mContainerView.getHeight())); } anim.addListener(mHideListener); mCurrentAnim = anim; |