diff options
author | Adam Powell <adamp@google.com> | 2010-11-11 21:11:53 -0800 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2010-11-12 19:06:40 -0800 |
commit | 6af97e1c20df4d7010fafd7059c95d9b4113e4a6 (patch) | |
tree | bc48a49d23a1441bc2687ba3ba663971a1700b41 /policy | |
parent | 95483c92f41e9f23a049b5c34ee1a6ae0bb01bd6 (diff) | |
download | frameworks_base-6af97e1c20df4d7010fafd7059c95d9b4113e4a6.zip frameworks_base-6af97e1c20df4d7010fafd7059c95d9b4113e4a6.tar.gz frameworks_base-6af97e1c20df4d7010fafd7059c95d9b4113e4a6.tar.bz2 |
Revised assets for progress bars and indeterminate progress spinners.
Add support in ActionBar for activity-wide progress APIs.
Add ability for progress bars to set a target framerate rather than
the 5fps previously used.
Clean up some more dialog layouts using hardcoded styles rather than
theme attributes.
Change-Id: I8e88c7595e27c0b6f7829b598f2b084ac8501ae3
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 71bf956..1090c71 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -2234,12 +2234,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { // XXX Remove this once action bar supports these features. removeFeature(FEATURE_ACTION_BAR); // System.out.println("Title Icons!"); - } else if ((features & ((1 << FEATURE_PROGRESS) | (1 << FEATURE_INDETERMINATE_PROGRESS))) != 0) { + } else if ((features & ((1 << FEATURE_PROGRESS) | (1 << FEATURE_INDETERMINATE_PROGRESS))) != 0 + && (features & (1 << FEATURE_ACTION_BAR)) == 0) { // Special case for a window with only a progress bar (and title). // XXX Need to have a no-title version of embedded windows. layoutResource = com.android.internal.R.layout.screen_progress; - // XXX Remove this once action bar supports these features. - removeFeature(FEATURE_ACTION_BAR); // System.out.println("Progress!"); } else if ((features & (1 << FEATURE_CUSTOM_TITLE)) != 0) { // Special case for a window with a custom title. @@ -2352,6 +2351,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mActionBar.getTitle() == null) { mActionBar.setWindowTitle(mTitle); } + final int localFeatures = getLocalFeatures(); + if ((localFeatures & (1 << FEATURE_PROGRESS)) != 0) { + mActionBar.initProgress(); + } + if ((localFeatures & (1 << FEATURE_INDETERMINATE_PROGRESS)) != 0) { + mActionBar.initIndeterminateProgress(); + } // Post the panel invalidate for later; avoid application onCreateOptionsMenu // being called in the middle of onCreate or similar. mDecor.post(new Runnable() { @@ -2543,8 +2549,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mContentParent == null && shouldInstallDecor) { installDecor(); } - mCircularProgressBar = (ProgressBar)findViewById(com.android.internal.R.id.progress_circular); - mCircularProgressBar.setVisibility(View.INVISIBLE); + mCircularProgressBar = (ProgressBar) findViewById(com.android.internal.R.id.progress_circular); + if (mCircularProgressBar != null) { + mCircularProgressBar.setVisibility(View.INVISIBLE); + } return mCircularProgressBar; } @@ -2555,8 +2563,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mContentParent == null && shouldInstallDecor) { installDecor(); } - mHorizontalProgressBar = (ProgressBar)findViewById(com.android.internal.R.id.progress_horizontal); - mHorizontalProgressBar.setVisibility(View.INVISIBLE); + mHorizontalProgressBar = (ProgressBar) findViewById(com.android.internal.R.id.progress_horizontal); + if (mHorizontalProgressBar != null) { + mHorizontalProgressBar.setVisibility(View.INVISIBLE); + } return mHorizontalProgressBar; } |