Fix bug 3345948 - ActionBar.show()/hide() shouldn't animate if called
before first layout
Enable/disable the action bar show/hide animation as part of the
activity/dialog lifecycle. This allows apps to set action bar
visibility state as the activity first becomes visible or returns to
visibility without the associated animation.
Change-Id: I85ff9268d2cb2c8fcd3364dd275597fe90529224
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 04d839d..aed0fa3 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -1067,6 +1067,7 @@
protected void onPostResume() {
final Window win = getWindow();
if (win != null) win.makeActive();
+ if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(true);
mCalled = true;
}
@@ -1319,6 +1320,7 @@
* @see #onDestroy
*/
protected void onStop() {
+ if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(false);
mCalled = true;
}