From 50efbed668a9410cdec51f7c8604fa44ed267fed Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Tue, 8 Feb 2011 16:20:15 -0800 Subject: 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 --- core/java/android/app/Dialog.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/java/android/app/Dialog.java') diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index de5d6a1bdf18..cc4fefc3ea3b 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -352,12 +352,14 @@ public class Dialog implements DialogInterface, Window.Callback, * Called when the dialog is starting. */ protected void onStart() { + if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(true); } /** * Called to tell you that you're stopping. */ protected void onStop() { + if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(false); } private static final String DIALOG_SHOWING_TAG = "android:dialogShowing"; -- cgit v1.2.3