From 6af97e1c20df4d7010fafd7059c95d9b4113e4a6 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 11 Nov 2010 21:11:53 -0800 Subject: 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 --- api/current.xml | 33 +++++++++++++ core/java/android/app/ProgressDialog.java | 2 +- core/java/android/widget/ProgressBar.java | 18 +++++-- .../com/android/internal/widget/ActionBarView.java | 54 ++++++++++++++++++++- .../res/drawable-hdpi/progress_bg_holo_dark.9.png | Bin 162 -> 313 bytes .../res/drawable-hdpi/progress_bg_holo_light.9.png | Bin 154 -> 156 bytes .../drawable-hdpi/progress_primary_holo_dark.9.png | Bin 715 -> 1618 bytes .../progress_primary_holo_light.9.png | Bin 465 -> 1654 bytes .../progress_secondary_holo_dark.9.png | Bin 164 -> 163 bytes .../progress_secondary_holo_light.9.png | Bin 164 -> 168 bytes .../res/drawable-hdpi/spinner_16_inner_holo.png | Bin 0 -> 789 bytes .../res/drawable-hdpi/spinner_16_outer_holo.png | Bin 0 -> 881 bytes .../res/drawable-hdpi/spinner_20_inner_holo.png | Bin 0 -> 1098 bytes .../res/drawable-hdpi/spinner_20_outer_holo.png | Bin 0 -> 1158 bytes .../res/drawable-hdpi/spinner_48_inner_holo.png | Bin 0 -> 2816 bytes .../res/drawable-hdpi/spinner_48_outer_holo.png | Bin 0 -> 3439 bytes .../res/drawable-hdpi/spinner_76_inner_holo.png | Bin 0 -> 4870 bytes .../res/drawable-hdpi/spinner_76_outer_holo.png | Bin 0 -> 6489 bytes .../res/drawable-mdpi/progress_bg_holo_dark.9.png | Bin 1040 -> 1170 bytes .../res/drawable-mdpi/progress_bg_holo_light.9.png | Bin 1059 -> 1074 bytes .../drawable-mdpi/progress_primary_holo_dark.9.png | Bin 1564 -> 2269 bytes .../progress_primary_holo_light.9.png | Bin 1317 -> 2296 bytes .../progress_secondary_holo_dark.9.png | Bin 1047 -> 1067 bytes .../progress_secondary_holo_light.9.png | Bin 1070 -> 1080 bytes .../res/drawable-mdpi/spinner_16_inner_holo.png | Bin 0 -> 1349 bytes .../res/drawable-mdpi/spinner_16_outer_holo.png | Bin 0 -> 1531 bytes .../res/drawable-mdpi/spinner_20_inner_holo.png | Bin 0 -> 1613 bytes .../res/drawable-mdpi/spinner_20_outer_holo.png | Bin 0 -> 1767 bytes .../res/drawable-mdpi/spinner_48_inner_holo.png | Bin 0 -> 3457 bytes .../res/drawable-mdpi/spinner_48_outer_holo.png | Bin 0 -> 3715 bytes .../res/drawable-mdpi/spinner_76_inner_holo.png | Bin 0 -> 5844 bytes .../res/drawable-mdpi/spinner_76_outer_holo.png | Bin 0 -> 6201 bytes core/res/res/drawable/progress_large_holo.xml | 34 +++++++++++++ core/res/res/drawable/progress_medium_holo.xml | 34 +++++++++++++ core/res/res/drawable/progress_small_holo.xml | 34 +++++++++++++ core/res/res/layout/progress_dialog.xml | 2 +- core/res/res/values/attrs.xml | 8 +++ core/res/res/values/public.xml | 3 ++ core/res/res/values/styles.xml | 41 ++++++++++------ core/res/res/values/themes.xml | 18 +++---- .../android/graphics/drawable/RotateDrawable.java | 2 - .../android/internal/policy/impl/PhoneWindow.java | 24 ++++++--- 42 files changed, 268 insertions(+), 39 deletions(-) create mode 100644 core/res/res/drawable-hdpi/spinner_16_inner_holo.png create mode 100644 core/res/res/drawable-hdpi/spinner_16_outer_holo.png create mode 100644 core/res/res/drawable-hdpi/spinner_20_inner_holo.png create mode 100644 core/res/res/drawable-hdpi/spinner_20_outer_holo.png create mode 100644 core/res/res/drawable-hdpi/spinner_48_inner_holo.png create mode 100644 core/res/res/drawable-hdpi/spinner_48_outer_holo.png create mode 100644 core/res/res/drawable-hdpi/spinner_76_inner_holo.png create mode 100644 core/res/res/drawable-hdpi/spinner_76_outer_holo.png create mode 100644 core/res/res/drawable-mdpi/spinner_16_inner_holo.png create mode 100644 core/res/res/drawable-mdpi/spinner_16_outer_holo.png create mode 100644 core/res/res/drawable-mdpi/spinner_20_inner_holo.png create mode 100644 core/res/res/drawable-mdpi/spinner_20_outer_holo.png create mode 100644 core/res/res/drawable-mdpi/spinner_48_inner_holo.png create mode 100644 core/res/res/drawable-mdpi/spinner_48_outer_holo.png create mode 100644 core/res/res/drawable-mdpi/spinner_76_inner_holo.png create mode 100644 core/res/res/drawable-mdpi/spinner_76_outer_holo.png create mode 100644 core/res/res/drawable/progress_large_holo.xml create mode 100644 core/res/res/drawable/progress_medium_holo.xml create mode 100644 core/res/res/drawable/progress_small_holo.xml diff --git a/api/current.xml b/api/current.xml index 15224ce..8a5e0d6 100644 --- a/api/current.xml +++ b/api/current.xml @@ -2297,6 +2297,17 @@ visibility="public" > + + + + + + = ANIMATION_RESOLUTION) { + if (SystemClock.uptimeMillis() - mLastDrawTime >= mAnimationResolution) { mLastDrawTime = SystemClock.uptimeMillis(); - postInvalidateDelayed(ANIMATION_RESOLUTION); + postInvalidateDelayed(mAnimationResolution); } } d.draw(canvas); diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index 7a64da0..0a4f543 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -26,7 +26,6 @@ import android.app.ActionBar.NavigationCallback; import android.app.Activity; import android.content.Context; import android.content.pm.ApplicationInfo; -import android.content.pm.ComponentInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.TypedArray; @@ -45,6 +44,7 @@ import android.widget.AdapterView; import android.widget.HorizontalScrollView; import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.ProgressBar; import android.widget.Spinner; import android.widget.SpinnerAdapter; import android.widget.TextView; @@ -94,9 +94,15 @@ public class ActionBarView extends ViewGroup { private HorizontalScrollView mTabScrollView; private LinearLayout mTabLayout; private View mCustomNavView; + private ProgressBar mProgressView; + private ProgressBar mIndeterminateProgressView; + + private int mProgressBarPadding; private int mTitleStyleRes; private int mSubtitleStyleRes; + private int mProgressStyle; + private int mIndeterminateProgressStyle; private boolean mShowMenu; private boolean mUserTitle; @@ -185,6 +191,11 @@ public class ActionBarView extends ViewGroup { mTitleStyleRes = a.getResourceId(R.styleable.ActionBar_titleTextStyle, 0); mSubtitleStyleRes = a.getResourceId(R.styleable.ActionBar_subtitleTextStyle, 0); + mProgressStyle = a.getResourceId(R.styleable.ActionBar_progressBarStyle, 0); + mIndeterminateProgressStyle = a.getResourceId( + R.styleable.ActionBar_indeterminateProgressStyle, 0); + + mProgressBarPadding = a.getDimensionPixelOffset(R.styleable.ActionBar_progressBarPadding, 0); setDisplayOptions(a.getInt(R.styleable.ActionBar_displayOptions, DISPLAY_DEFAULT)); @@ -216,6 +227,20 @@ public class ActionBarView extends ViewGroup { mHomeLayout.setFocusable(true); } + public void initProgress() { + mProgressView = new ProgressBar(mContext, null, 0, mProgressStyle); + mProgressView.setId(R.id.progress_horizontal); + mProgressView.setMax(10000); + addView(mProgressView); + } + + public void initIndeterminateProgress() { + mIndeterminateProgressView = new ProgressBar(mContext, null, 0, + mIndeterminateProgressStyle); + mIndeterminateProgressView.setId(R.id.progress_circular); + addView(mIndeterminateProgressView); + } + @Override public ActionMode startActionModeForChild(View child, ActionMode.Callback callback) { // No starting an action mode for an action bar child! (Where would it go?) @@ -665,6 +690,13 @@ public class ActionBarView extends ViewGroup { break; } + if (mIndeterminateProgressView != null && + mIndeterminateProgressView.getVisibility() != GONE) { + availableWidth = measureChildView(mIndeterminateProgressView, availableWidth, + childSpecHeight, 0); + rightOfCenter -= mIndeterminateProgressView.getMeasuredWidth(); + } + if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0 && mCustomNavView != null) { final LayoutParams lp = generateLayoutParams(mCustomNavView.getLayoutParams()); final ActionBar.LayoutParams ablp = lp instanceof ActionBar.LayoutParams ? @@ -726,6 +758,12 @@ public class ActionBarView extends ViewGroup { if (mContextView != null) { mContextView.setHeight(getMeasuredHeight()); } + + if (mProgressView != null && mProgressView.getVisibility() != GONE) { + mProgressView.measure(MeasureSpec.makeMeasureSpec( + contentWidth - mProgressBarPadding * 2, MeasureSpec.EXACTLY), + MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST)); + } } private int measureChildView(View child, int availableWidth, int childSpecHeight, int spacing) { @@ -764,6 +802,7 @@ public class ActionBarView extends ViewGroup { if (mTabScrollView != null) { x += positionChild(mTabScrollView, x, y, contentHeight); } + break; } int menuLeft = r - l - getPaddingRight(); @@ -772,6 +811,12 @@ public class ActionBarView extends ViewGroup { menuLeft -= mMenuView.getMeasuredWidth(); } + if (mIndeterminateProgressView != null && + mIndeterminateProgressView.getVisibility() != GONE) { + positionChildInverse(mIndeterminateProgressView, menuLeft, y, contentHeight); + menuLeft -= mIndeterminateProgressView.getMeasuredWidth(); + } + if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) { LayoutParams lp = mCustomNavView.getLayoutParams(); final ActionBar.LayoutParams ablp = lp instanceof ActionBar.LayoutParams ? @@ -830,6 +875,13 @@ public class ActionBarView extends ViewGroup { } x += positionChild(mCustomNavView, xpos, ypos, contentHeight); } + + if (mProgressView != null) { + mProgressView.bringToFront(); + final int halfProgressHeight = mProgressView.getMeasuredHeight() / 2; + mProgressView.layout(mProgressBarPadding, -halfProgressHeight, + mProgressBarPadding + mProgressView.getMeasuredWidth(), halfProgressHeight); + } } private int positionChild(View child, int x, int y, int contentHeight) { diff --git a/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png b/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png index 192df6d..079de61 100644 Binary files a/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png and b/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png differ diff --git a/core/res/res/drawable-hdpi/progress_bg_holo_light.9.png b/core/res/res/drawable-hdpi/progress_bg_holo_light.9.png index 223416d..2272b41 100644 Binary files a/core/res/res/drawable-hdpi/progress_bg_holo_light.9.png and b/core/res/res/drawable-hdpi/progress_bg_holo_light.9.png differ diff --git a/core/res/res/drawable-hdpi/progress_primary_holo_dark.9.png b/core/res/res/drawable-hdpi/progress_primary_holo_dark.9.png index 1a59124..16b7349 100644 Binary files a/core/res/res/drawable-hdpi/progress_primary_holo_dark.9.png and b/core/res/res/drawable-hdpi/progress_primary_holo_dark.9.png differ diff --git a/core/res/res/drawable-hdpi/progress_primary_holo_light.9.png b/core/res/res/drawable-hdpi/progress_primary_holo_light.9.png index f119c6a..7229343 100644 Binary files a/core/res/res/drawable-hdpi/progress_primary_holo_light.9.png and b/core/res/res/drawable-hdpi/progress_primary_holo_light.9.png differ diff --git a/core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.png b/core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.png index 3c6c5ed..894dfcf 100644 Binary files a/core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.png and b/core/res/res/drawable-hdpi/progress_secondary_holo_dark.9.png differ diff --git a/core/res/res/drawable-hdpi/progress_secondary_holo_light.9.png b/core/res/res/drawable-hdpi/progress_secondary_holo_light.9.png index cab3888..f553ba6 100644 Binary files a/core/res/res/drawable-hdpi/progress_secondary_holo_light.9.png and b/core/res/res/drawable-hdpi/progress_secondary_holo_light.9.png differ diff --git a/core/res/res/drawable-hdpi/spinner_16_inner_holo.png b/core/res/res/drawable-hdpi/spinner_16_inner_holo.png new file mode 100644 index 0000000..ff363f0 Binary files /dev/null and b/core/res/res/drawable-hdpi/spinner_16_inner_holo.png differ diff --git a/core/res/res/drawable-hdpi/spinner_16_outer_holo.png b/core/res/res/drawable-hdpi/spinner_16_outer_holo.png new file mode 100644 index 0000000..a5a0b98 Binary files /dev/null and b/core/res/res/drawable-hdpi/spinner_16_outer_holo.png differ diff --git a/core/res/res/drawable-hdpi/spinner_20_inner_holo.png b/core/res/res/drawable-hdpi/spinner_20_inner_holo.png new file mode 100644 index 0000000..16742e8 Binary files /dev/null and b/core/res/res/drawable-hdpi/spinner_20_inner_holo.png differ diff --git a/core/res/res/drawable-hdpi/spinner_20_outer_holo.png b/core/res/res/drawable-hdpi/spinner_20_outer_holo.png new file mode 100644 index 0000000..d6aa73b Binary files /dev/null and b/core/res/res/drawable-hdpi/spinner_20_outer_holo.png differ diff --git a/core/res/res/drawable-hdpi/spinner_48_inner_holo.png b/core/res/res/drawable-hdpi/spinner_48_inner_holo.png new file mode 100644 index 0000000..ee3f4c2 Binary files /dev/null and b/core/res/res/drawable-hdpi/spinner_48_inner_holo.png differ diff --git a/core/res/res/drawable-hdpi/spinner_48_outer_holo.png b/core/res/res/drawable-hdpi/spinner_48_outer_holo.png new file mode 100644 index 0000000..7c59e2f Binary files /dev/null and b/core/res/res/drawable-hdpi/spinner_48_outer_holo.png differ diff --git a/core/res/res/drawable-hdpi/spinner_76_inner_holo.png b/core/res/res/drawable-hdpi/spinner_76_inner_holo.png new file mode 100644 index 0000000..a1ef44c Binary files /dev/null and b/core/res/res/drawable-hdpi/spinner_76_inner_holo.png differ diff --git a/core/res/res/drawable-hdpi/spinner_76_outer_holo.png b/core/res/res/drawable-hdpi/spinner_76_outer_holo.png new file mode 100644 index 0000000..69e3ab7 Binary files /dev/null and b/core/res/res/drawable-hdpi/spinner_76_outer_holo.png differ diff --git a/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png b/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png index 316af64..0376e53 100644 Binary files a/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png and b/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png differ diff --git a/core/res/res/drawable-mdpi/progress_bg_holo_light.9.png b/core/res/res/drawable-mdpi/progress_bg_holo_light.9.png index e286136..e825119 100644 Binary files a/core/res/res/drawable-mdpi/progress_bg_holo_light.9.png and b/core/res/res/drawable-mdpi/progress_bg_holo_light.9.png differ diff --git a/core/res/res/drawable-mdpi/progress_primary_holo_dark.9.png b/core/res/res/drawable-mdpi/progress_primary_holo_dark.9.png index 0502669..e525eaf 100644 Binary files a/core/res/res/drawable-mdpi/progress_primary_holo_dark.9.png and b/core/res/res/drawable-mdpi/progress_primary_holo_dark.9.png differ diff --git a/core/res/res/drawable-mdpi/progress_primary_holo_light.9.png b/core/res/res/drawable-mdpi/progress_primary_holo_light.9.png index 1ba9e34..0532f0e 100644 Binary files a/core/res/res/drawable-mdpi/progress_primary_holo_light.9.png and b/core/res/res/drawable-mdpi/progress_primary_holo_light.9.png differ diff --git a/core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.png b/core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.png index a2fe2b3..99f8f06 100644 Binary files a/core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.png and b/core/res/res/drawable-mdpi/progress_secondary_holo_dark.9.png differ diff --git a/core/res/res/drawable-mdpi/progress_secondary_holo_light.9.png b/core/res/res/drawable-mdpi/progress_secondary_holo_light.9.png index 3b264ab..198d7d9 100644 Binary files a/core/res/res/drawable-mdpi/progress_secondary_holo_light.9.png and b/core/res/res/drawable-mdpi/progress_secondary_holo_light.9.png differ diff --git a/core/res/res/drawable-mdpi/spinner_16_inner_holo.png b/core/res/res/drawable-mdpi/spinner_16_inner_holo.png new file mode 100644 index 0000000..2703553 Binary files /dev/null and b/core/res/res/drawable-mdpi/spinner_16_inner_holo.png differ diff --git a/core/res/res/drawable-mdpi/spinner_16_outer_holo.png b/core/res/res/drawable-mdpi/spinner_16_outer_holo.png new file mode 100644 index 0000000..87d2c87 Binary files /dev/null and b/core/res/res/drawable-mdpi/spinner_16_outer_holo.png differ diff --git a/core/res/res/drawable-mdpi/spinner_20_inner_holo.png b/core/res/res/drawable-mdpi/spinner_20_inner_holo.png new file mode 100644 index 0000000..3c97355 Binary files /dev/null and b/core/res/res/drawable-mdpi/spinner_20_inner_holo.png differ diff --git a/core/res/res/drawable-mdpi/spinner_20_outer_holo.png b/core/res/res/drawable-mdpi/spinner_20_outer_holo.png new file mode 100644 index 0000000..96155e3 Binary files /dev/null and b/core/res/res/drawable-mdpi/spinner_20_outer_holo.png differ diff --git a/core/res/res/drawable-mdpi/spinner_48_inner_holo.png b/core/res/res/drawable-mdpi/spinner_48_inner_holo.png new file mode 100644 index 0000000..26dcfbf Binary files /dev/null and b/core/res/res/drawable-mdpi/spinner_48_inner_holo.png differ diff --git a/core/res/res/drawable-mdpi/spinner_48_outer_holo.png b/core/res/res/drawable-mdpi/spinner_48_outer_holo.png new file mode 100644 index 0000000..49dad0c Binary files /dev/null and b/core/res/res/drawable-mdpi/spinner_48_outer_holo.png differ diff --git a/core/res/res/drawable-mdpi/spinner_76_inner_holo.png b/core/res/res/drawable-mdpi/spinner_76_inner_holo.png new file mode 100644 index 0000000..ebccabd Binary files /dev/null and b/core/res/res/drawable-mdpi/spinner_76_inner_holo.png differ diff --git a/core/res/res/drawable-mdpi/spinner_76_outer_holo.png b/core/res/res/drawable-mdpi/spinner_76_outer_holo.png new file mode 100644 index 0000000..37d3f58 Binary files /dev/null and b/core/res/res/drawable-mdpi/spinner_76_outer_holo.png differ diff --git a/core/res/res/drawable/progress_large_holo.xml b/core/res/res/drawable/progress_large_holo.xml new file mode 100644 index 0000000..5865780 --- /dev/null +++ b/core/res/res/drawable/progress_large_holo.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/core/res/res/drawable/progress_medium_holo.xml b/core/res/res/drawable/progress_medium_holo.xml new file mode 100644 index 0000000..6772f58 --- /dev/null +++ b/core/res/res/drawable/progress_medium_holo.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/core/res/res/drawable/progress_small_holo.xml b/core/res/res/drawable/progress_small_holo.xml new file mode 100644 index 0000000..1d3b62b --- /dev/null +++ b/core/res/res/drawable/progress_small_holo.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/core/res/res/layout/progress_dialog.xml b/core/res/res/layout/progress_dialog.xml index 298173a..08e720f 100644 --- a/core/res/res/layout/progress_dialog.xml +++ b/core/res/res/layout/progress_dialog.xml @@ -33,7 +33,7 @@ android:paddingBottom="10dip"> + + @@ -4379,6 +4381,12 @@ + + + + + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 28df995..3eb980f 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1372,6 +1372,9 @@ + + + diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 457175b..8bec87b 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -920,6 +920,8 @@ 0dip @android:style/TextAppearance.Widget.ActionBar.Title @android:style/TextAppearance.Widget.ActionBar.Subtitle + @android:style/Widget.ProgressBar.Horizontal + @android:style/Widget.ProgressBar.Small - - - - - @@ -1645,29 +1654,29 @@ - - - - - - - - diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index c8cce81..8082f6b 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -1031,15 +1031,15 @@ @android:style/Widget.Holo.ImageWell @android:style/Widget.Holo.ListView @android:style/Widget.Holo.ListView.White - @android:style/Widget.Holo.PopupWindow - @android:style/Widget.Holo.ProgressBar - @android:style/Widget.Holo.ProgressBar.Horizontal - @android:style/Widget.Holo.ProgressBar.Small - @android:style/Widget.Holo.ProgressBar.Small.Title - @android:style/Widget.Holo.ProgressBar.Large - @android:style/Widget.Holo.ProgressBar.Inverse - @android:style/Widget.Holo.ProgressBar.Small.Inverse - @android:style/Widget.Holo.ProgressBar.Large.Inverse + @android:style/Widget.Holo.Light.PopupWindow + @android:style/Widget.Holo.Light.ProgressBar + @android:style/Widget.Holo.Light.ProgressBar.Horizontal + @android:style/Widget.Holo.Light.ProgressBar.Small + @android:style/Widget.Holo.Light.ProgressBar.Small.Title + @android:style/Widget.Holo.Light.ProgressBar.Large + @android:style/Widget.Holo.Light.ProgressBar.Inverse + @android:style/Widget.Holo.Light.ProgressBar.Small.Inverse + @android:style/Widget.Holo.Light.ProgressBar.Large.Inverse @android:style/Widget.Holo.SeekBar @android:style/Widget.Holo.RatingBar @android:style/Widget.Holo.RatingBar.Indicator diff --git a/graphics/java/android/graphics/drawable/RotateDrawable.java b/graphics/java/android/graphics/drawable/RotateDrawable.java index 9c47dab..f3f3653 100644 --- a/graphics/java/android/graphics/drawable/RotateDrawable.java +++ b/graphics/java/android/graphics/drawable/RotateDrawable.java @@ -232,8 +232,6 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { float toDegrees = a.getFloat( com.android.internal.R.styleable.RotateDrawable_toDegrees, 360.0f); - toDegrees = Math.max(fromDegrees, toDegrees); - int res = a.getResourceId( com.android.internal.R.styleable.RotateDrawable_drawable, 0); Drawable drawable = null; 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; } -- cgit v1.1