diff options
| author | Chet Haase <chet@google.com> | 2012-05-30 17:22:37 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-30 17:22:37 -0700 |
| commit | 762ca84cb26b06cfc758db38f4af6edfcf6a4349 (patch) | |
| tree | 22b774d96a418e4d97327b8088fb30b04695dbf2 /core | |
| parent | efc620a8b905fbe0903b8bac6ecfe91fda6f03be (diff) | |
| parent | e8118e17b2f088f2ebecfbe050c4ffa80f686abf (diff) | |
| download | frameworks_base-762ca84cb26b06cfc758db38f4af6edfcf6a4349.zip frameworks_base-762ca84cb26b06cfc758db38f4af6edfcf6a4349.tar.gz frameworks_base-762ca84cb26b06cfc758db38f4af6edfcf6a4349.tar.bz2 | |
Merge "Sped up ActionBar and StatusBar animations" into jb-dev
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/com/android/internal/app/ActionBarImpl.java | 45 | ||||
| -rw-r--r-- | core/res/res/anim/dock_bottom_enter.xml | 4 | ||||
| -rw-r--r-- | core/res/res/anim/dock_bottom_exit.xml | 4 | ||||
| -rw-r--r-- | core/res/res/anim/dock_left_enter.xml | 4 | ||||
| -rw-r--r-- | core/res/res/anim/dock_left_exit.xml | 4 | ||||
| -rw-r--r-- | core/res/res/anim/dock_right_enter.xml | 4 | ||||
| -rw-r--r-- | core/res/res/anim/dock_right_exit.xml | 4 | ||||
| -rw-r--r-- | core/res/res/anim/dock_top_enter.xml | 4 | ||||
| -rw-r--r-- | core/res/res/anim/dock_top_exit.xml | 4 |
9 files changed, 40 insertions, 37 deletions
diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java index 234cb71..46478ca 100644 --- a/core/java/com/android/internal/app/ActionBarImpl.java +++ b/core/java/com/android/internal/app/ActionBarImpl.java @@ -673,26 +673,29 @@ public class ActionBarImpl extends ActionBar { if (mCurWindowVisibility == View.VISIBLE && (mShowHideAnimationEnabled || fromSystem)) { - mTopVisibilityView.setAlpha(0); - mTopVisibilityView.setTranslationY(-mTopVisibilityView.getHeight()); + mTopVisibilityView.setTranslationY(0); // because we're about to ask its window loc + float startingY = -mTopVisibilityView.getHeight(); + if (fromSystem) { + int topLeft[] = {0, 0}; + mTopVisibilityView.getLocationInWindow(topLeft); + startingY -= topLeft[1]; + } + mTopVisibilityView.setTranslationY(startingY); AnimatorSet anim = new AnimatorSet(); - AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mTopVisibilityView, "alpha", 1)); - b.with(ObjectAnimator.ofFloat(mTopVisibilityView, "translationY", 0)); + AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mTopVisibilityView, + "translationY", 0)); if (mContentView != null) { b.with(ObjectAnimator.ofFloat(mContentView, "translationY", - -mTopVisibilityView.getHeight(), 0)); + startingY, 0)); } if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) { - mSplitView.setAlpha(0); mSplitView.setTranslationY(mSplitView.getHeight()); mSplitView.setVisibility(View.VISIBLE); - b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 1)); b.with(ObjectAnimator.ofFloat(mSplitView, "translationY", 0)); } anim.setInterpolator(AnimationUtils.loadInterpolator(mContext, - com.android.internal.R.interpolator.decelerate_quad)); - anim.setDuration(mContext.getResources().getInteger( - com.android.internal.R.integer.config_mediumAnimTime)); + com.android.internal.R.interpolator.decelerate_cubic)); + anim.setDuration(250); // If this is being shown from the system, add a small delay. // This is because we will also be animating in the status bar, // and these two elements can't be done in lock-step. So we give @@ -700,9 +703,6 @@ public class ActionBarImpl extends ActionBar { // the action bar animates. (This corresponds to the corresponding // case when hiding, where the status bar has a small delay before // starting.) - if (fromSystem) { - anim.setStartDelay(100); - } anim.addListener(mShowListener); mCurrentShowAnim = anim; anim.start(); @@ -734,23 +734,26 @@ public class ActionBarImpl extends ActionBar { mTopVisibilityView.setAlpha(1); mContainerView.setTransitioning(true); AnimatorSet anim = new AnimatorSet(); - AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mTopVisibilityView, "alpha", 0)); - b.with(ObjectAnimator.ofFloat(mTopVisibilityView, "translationY", - -mTopVisibilityView.getHeight())); + float endingY = -mTopVisibilityView.getHeight(); + if (fromSystem) { + int topLeft[] = {0, 0}; + mTopVisibilityView.getLocationInWindow(topLeft); + endingY -= topLeft[1]; + } + AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mTopVisibilityView, + "translationY", endingY)); if (mContentView != null) { b.with(ObjectAnimator.ofFloat(mContentView, "translationY", - 0, -mTopVisibilityView.getHeight())); + 0, endingY)); } if (mSplitView != null && mSplitView.getVisibility() == View.VISIBLE) { mSplitView.setAlpha(1); - b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 0)); b.with(ObjectAnimator.ofFloat(mSplitView, "translationY", mSplitView.getHeight())); } anim.setInterpolator(AnimationUtils.loadInterpolator(mContext, - com.android.internal.R.interpolator.accelerate_quad)); - anim.setDuration(mContext.getResources().getInteger( - com.android.internal.R.integer.config_mediumAnimTime)); + com.android.internal.R.interpolator.accelerate_cubic)); + anim.setDuration(250); anim.addListener(mHideListener); mCurrentShowAnim = anim; anim.start(); diff --git a/core/res/res/anim/dock_bottom_enter.xml b/core/res/res/anim/dock_bottom_enter.xml index 74a021b..4f2f753 100644 --- a/core/res/res/anim/dock_bottom_enter.xml +++ b/core/res/res/anim/dock_bottom_enter.xml @@ -18,7 +18,7 @@ <!-- Animation for when a dock window at the bottom of the screen is entering. --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:interpolator/decelerate_quad"> + android:interpolator="@android:interpolator/decelerate_cubic"> <translate android:fromYDelta="100%" android:toYDelta="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="250"/> </set> diff --git a/core/res/res/anim/dock_bottom_exit.xml b/core/res/res/anim/dock_bottom_exit.xml index 213b3d9..afbe24b 100644 --- a/core/res/res/anim/dock_bottom_exit.xml +++ b/core/res/res/anim/dock_bottom_exit.xml @@ -18,7 +18,7 @@ <!-- Animation for when a dock window at the bottom of the screen is exiting. --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:interpolator/accelerate_quad"> + android:interpolator="@android:interpolator/accelerate_cubic"> <translate android:fromYDelta="0" android:toYDelta="100%" - android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime"/> + android:startOffset="100" android:duration="250"/> </set> diff --git a/core/res/res/anim/dock_left_enter.xml b/core/res/res/anim/dock_left_enter.xml index 4fce35a..7f5dfd5 100644 --- a/core/res/res/anim/dock_left_enter.xml +++ b/core/res/res/anim/dock_left_enter.xml @@ -18,7 +18,7 @@ <!-- Animation for when a dock window at the left of the screen is entering. --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:interpolator/decelerate_quad"> + android:interpolator="@android:interpolator/decelerate_cubic"> <translate android:fromXDelta="-100%" android:toXDelta="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="250"/> </set> diff --git a/core/res/res/anim/dock_left_exit.xml b/core/res/res/anim/dock_left_exit.xml index bce203d..11cbc0b 100644 --- a/core/res/res/anim/dock_left_exit.xml +++ b/core/res/res/anim/dock_left_exit.xml @@ -18,7 +18,7 @@ <!-- Animation for when a dock window at the right of the screen is exiting. --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:interpolator/accelerate_quad"> + android:interpolator="@android:interpolator/accelerate_cubic"> <translate android:fromXDelta="0" android:toXDelta="-100%" - android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime"/> + android:startOffset="100" android:duration="250"/> </set> diff --git a/core/res/res/anim/dock_right_enter.xml b/core/res/res/anim/dock_right_enter.xml index 26b8ad6..a92c7d2 100644 --- a/core/res/res/anim/dock_right_enter.xml +++ b/core/res/res/anim/dock_right_enter.xml @@ -18,7 +18,7 @@ <!-- Animation for when a dock window at the right of the screen is entering. --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:interpolator/decelerate_quad"> + android:interpolator="@android:interpolator/decelerate_cubic"> <translate android:fromXDelta="100%" android:toXDelta="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="250"/> </set> diff --git a/core/res/res/anim/dock_right_exit.xml b/core/res/res/anim/dock_right_exit.xml index 6beda59..80e4dc3 100644 --- a/core/res/res/anim/dock_right_exit.xml +++ b/core/res/res/anim/dock_right_exit.xml @@ -18,7 +18,7 @@ <!-- Animation for when a dock window at the right of the screen is exiting. --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:interpolator/accelerate_quad"> + android:interpolator="@android:interpolator/accelerate_cubic"> <translate android:fromXDelta="0" android:toXDelta="100%" - android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime"/> + android:startOffset="100" android:duration="250"/> </set> diff --git a/core/res/res/anim/dock_top_enter.xml b/core/res/res/anim/dock_top_enter.xml index 594b479..1f74e48 100644 --- a/core/res/res/anim/dock_top_enter.xml +++ b/core/res/res/anim/dock_top_enter.xml @@ -18,7 +18,7 @@ <!-- Animation for when a dock window at the top of the screen is entering. --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:interpolator/decelerate_quad"> + android:interpolator="@android:interpolator/decelerate_cubic"> <translate android:fromYDelta="-100%" android:toYDelta="0" - android:duration="@android:integer/config_mediumAnimTime"/> + android:duration="250"/> </set> diff --git a/core/res/res/anim/dock_top_exit.xml b/core/res/res/anim/dock_top_exit.xml index b9691f6..4d2fea9 100644 --- a/core/res/res/anim/dock_top_exit.xml +++ b/core/res/res/anim/dock_top_exit.xml @@ -18,7 +18,7 @@ <!-- Animation for when a dock window at the top of the screen is exiting. --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:interpolator/accelerate_quad"> + android:interpolator="@android:interpolator/accelerate_cubic"> <translate android:fromYDelta="0" android:toYDelta="-100%" - android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime"/> + android:startOffset="100" android:duration="250"/> </set> |
