diff options
| author | Romain Guy <romainguy@android.com> | 2009-06-30 12:39:18 -0700 |
|---|---|---|
| committer | Romain Guy <romainguy@android.com> | 2009-06-30 12:39:18 -0700 |
| commit | b5537c452271634b6ff3981b0624fa65384abd5b (patch) | |
| tree | 66159c3caed7ad21c6afb61974b77278d32097aa /core | |
| parent | 2f8d58b7ae2b9dc60eed83e5dddc8c28223e1ede (diff) | |
| download | frameworks_base-b5537c452271634b6ff3981b0624fa65384abd5b.zip frameworks_base-b5537c452271634b6ff3981b0624fa65384abd5b.tar.gz frameworks_base-b5537c452271634b6ff3981b0624fa65384abd5b.tar.bz2 | |
Replace indeterminate progress animated asset with new ones
Diffstat (limited to 'core')
19 files changed, 213 insertions, 180 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 6fe4896..44d1eaa 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -34,6 +34,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.database.Cursor; import android.graphics.drawable.Drawable; +import android.graphics.drawable.Animatable; import android.net.Uri; import android.os.Bundle; import android.os.SystemClock; @@ -422,11 +423,11 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS if (working) { mSearchAutoComplete.setCompoundDrawablesWithIntrinsicBounds( null, null, mWorkingSpinner, null); -// mWorkingSpinner.start(); + ((Animatable) mWorkingSpinner).start(); } else { mSearchAutoComplete.setCompoundDrawablesWithIntrinsicBounds( null, null, null, null); -// mWorkingSpinner.stop(); + ((Animatable) mWorkingSpinner).stop(); } } diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java index 441414a..2c9e71e 100644 --- a/core/java/android/widget/ProgressBar.java +++ b/core/java/android/widget/ProgressBar.java @@ -30,6 +30,7 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.StateListDrawable; +import android.graphics.drawable.Animatable; import android.graphics.drawable.shapes.RoundRectShape; import android.graphics.drawable.shapes.Shape; import android.util.AttributeSet; @@ -683,7 +684,7 @@ public class ProgressBar extends View { return; } - if (mIndeterminateDrawable instanceof AnimationDrawable) { + if (mIndeterminateDrawable instanceof Animatable) { mShouldStartAnimationDrawable = true; mAnimation = null; } else { @@ -708,8 +709,8 @@ public class ProgressBar extends View { void stopAnimation() { mAnimation = null; mTransformation = null; - if (mIndeterminateDrawable instanceof AnimationDrawable) { - ((AnimationDrawable) mIndeterminateDrawable).stop(); + if (mIndeterminateDrawable instanceof Animatable) { + ((Animatable) mIndeterminateDrawable).stop(); mShouldStartAnimationDrawable = false; } } @@ -818,8 +819,8 @@ public class ProgressBar extends View { } d.draw(canvas); canvas.restore(); - if (mShouldStartAnimationDrawable && d instanceof AnimationDrawable) { - ((AnimationDrawable) d).start(); + if (mShouldStartAnimationDrawable && d instanceof Animatable) { + ((Animatable) d).start(); mShouldStartAnimationDrawable = false; } } diff --git a/core/res/res/drawable/progress_large.xml b/core/res/res/drawable/progress_large.xml index 4669104..4f016bc 100644 --- a/core/res/res/drawable/progress_large.xml +++ b/core/res/res/drawable/progress_large.xml @@ -1,45 +1,25 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +<!-- +/* +** +** Copyright 2009, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ --> - - -<rotate xmlns:android="http://schemas.android.com/apk/res/android" - android:pivotX="50%" android:pivotY="50%" - android:fromDegrees="0" android:toDegrees="360"> - - <shape - android:shape="ring" - android:innerRadiusRatio="3" - android:thicknessRatio="8" - android:useLevel="false"> - - <size - android:width="76dip" - android:height="76dip" - /> - - <gradient - android:type="sweep" - android:useLevel="false" - android:startColor="#4c737373" - android:centerColor="#4c737373" - android:centerY="0.50" - android:endColor="#ffffd300" - /> - - </shape> - -</rotate> - +<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/spinner_black_76" + android:pivotX="50%" + android:pivotY="50%" + android:framesCount="12" + android:frameDuration="100" /> diff --git a/core/res/res/drawable/progress_large_white.xml b/core/res/res/drawable/progress_large_white.xml new file mode 100644 index 0000000..c690ed4 --- /dev/null +++ b/core/res/res/drawable/progress_large_white.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2009, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/spinner_white_76" + android:pivotX="50%" + android:pivotY="50%" + android:framesCount="12" + android:frameDuration="100" /> diff --git a/core/res/res/drawable/progress_medium.xml b/core/res/res/drawable/progress_medium.xml index 92aebb5..eb1bd50 100644 --- a/core/res/res/drawable/progress_medium.xml +++ b/core/res/res/drawable/progress_medium.xml @@ -1,43 +1,25 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +<!-- +/* +** +** Copyright 2009, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ --> - -<rotate xmlns:android="http://schemas.android.com/apk/res/android" - android:pivotX="50%" android:pivotY="50%" - android:fromDegrees="0" android:toDegrees="360"> - - <shape - android:shape="ring" - android:innerRadiusRatio="3" - android:thicknessRatio="8" - android:useLevel="false"> - - <size - android:width="48dip" - android:height="48dip" - /> - - <gradient - android:type="sweep" - android:useLevel="false" - android:startColor="#4c737373" - android:centerColor="#4c737373" - android:centerY="0.50" - android:endColor="#ffffd300" - /> - - </shape> - -</rotate> +<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/spinner_black_48" + android:pivotX="50%" + android:pivotY="50%" + android:framesCount="12" + android:frameDuration="100" /> diff --git a/core/res/res/drawable/progress_medium_white.xml b/core/res/res/drawable/progress_medium_white.xml new file mode 100644 index 0000000..b4f9b31 --- /dev/null +++ b/core/res/res/drawable/progress_medium_white.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2009, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/spinner_white_48" + android:pivotX="50%" + android:pivotY="50%" + android:framesCount="12" + android:frameDuration="100" /> diff --git a/core/res/res/drawable/progress_small.xml b/core/res/res/drawable/progress_small.xml index e5b0021..e0ee5e4 100644 --- a/core/res/res/drawable/progress_small.xml +++ b/core/res/res/drawable/progress_small.xml @@ -1,45 +1,25 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +<!-- +/* +** +** Copyright 2009, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ --> - - -<rotate xmlns:android="http://schemas.android.com/apk/res/android" - android:pivotX="50%" android:pivotY="50%" - android:fromDegrees="0" android:toDegrees="360"> - - <!-- An extra pixel is added on both ratios for stroke --> - <shape - android:shape="ring" - android:innerRadiusRatio="3.2" - android:thicknessRatio="5.333" - android:useLevel="false"> - - <size - android:width="16dip" - android:height="16dip" - /> - - <gradient - android:type="sweep" - android:useLevel="false" - android:startColor="#4c737373" - android:centerColor="#4c737373" - android:centerY="0.50" - android:endColor="#ffffd300" - /> - - </shape> - -</rotate> +<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/spinner_black_16" + android:pivotX="50%" + android:pivotY="50%" + android:framesCount="12" + android:frameDuration="100" /> diff --git a/core/res/res/drawable/progress_small_titlebar.xml b/core/res/res/drawable/progress_small_titlebar.xml index cf8e41c..8cfba86 100644 --- a/core/res/res/drawable/progress_small_titlebar.xml +++ b/core/res/res/drawable/progress_small_titlebar.xml @@ -1,45 +1,25 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2007 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +<!-- +/* +** +** Copyright 2009, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ --> - - -<rotate xmlns:android="http://schemas.android.com/apk/res/android" - android:pivotX="50%" android:pivotY="50%" - android:fromDegrees="0" android:toDegrees="360"> - - <!-- An extra pixel is added on both ratios for stroke --> - <shape - android:shape="ring" - android:innerRadiusRatio="3.2" - android:thicknessRatio="5.333" - android:useLevel="false"> - - <size - android:width="16dip" - android:height="16dip" - /> - - <gradient - android:type="sweep" - android:useLevel="false" - android:startColor="#ff666666" - android:centerColor="#ff666666" - android:centerY="0.50" - android:endColor="#ffffd300" - /> - - </shape> - -</rotate> +<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/spinner_white_16" + android:pivotX="50%" + android:pivotY="50%" + android:framesCount="12" + android:frameDuration="100" /> diff --git a/core/res/res/drawable/progress_small_white.xml b/core/res/res/drawable/progress_small_white.xml new file mode 100644 index 0000000..8cfba86 --- /dev/null +++ b/core/res/res/drawable/progress_small_white.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2009, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" + android:drawable="@drawable/spinner_white_16" + android:pivotX="50%" + android:pivotY="50%" + android:framesCount="12" + android:frameDuration="100" /> diff --git a/core/res/res/drawable/spinner_black_16.png b/core/res/res/drawable/spinner_black_16.png Binary files differnew file mode 100644 index 0000000..5ee33ce --- /dev/null +++ b/core/res/res/drawable/spinner_black_16.png diff --git a/core/res/res/drawable/spinner_black_48.png b/core/res/res/drawable/spinner_black_48.png Binary files differnew file mode 100644 index 0000000..3a68192 --- /dev/null +++ b/core/res/res/drawable/spinner_black_48.png diff --git a/core/res/res/drawable/spinner_black_76.png b/core/res/res/drawable/spinner_black_76.png Binary files differnew file mode 100644 index 0000000..ec57460 --- /dev/null +++ b/core/res/res/drawable/spinner_black_76.png diff --git a/core/res/res/drawable/spinner_white_16.png b/core/res/res/drawable/spinner_white_16.png Binary files differnew file mode 100644 index 0000000..dd2e1fd --- /dev/null +++ b/core/res/res/drawable/spinner_white_16.png diff --git a/core/res/res/drawable/spinner_white_48.png b/core/res/res/drawable/spinner_white_48.png Binary files differnew file mode 100644 index 0000000..d25a33e --- /dev/null +++ b/core/res/res/drawable/spinner_white_48.png diff --git a/core/res/res/drawable/spinner_white_76.png b/core/res/res/drawable/spinner_white_76.png Binary files differnew file mode 100644 index 0000000..f53e8ff --- /dev/null +++ b/core/res/res/drawable/spinner_white_76.png diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index d070107..3e93b02 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -350,6 +350,12 @@ <attr name="progressBarStyleSmallTitle" format="reference" /> <!-- Large ProgressBar style. This is a large circular progress bar. --> <attr name="progressBarStyleLarge" format="reference" /> + <!-- Inverse ProgressBar style. This is a medium circular progress bar. --> + <attr name="progressBarStyleInverse" format="reference" /> + <!-- Small inverse ProgressBar style. This is a small circular progress bar. --> + <attr name="progressBarStyleSmallInverse" format="reference" /> + <!-- Large inverse ProgressBar style. This is a large circular progress bar. --> + <attr name="progressBarStyleLargeInverse" format="reference" /> <!-- Default SeekBar style. --> <attr name="seekBarStyle" format="reference" /> <!-- Default RatingBar style. --> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 14d8dbe..2121669 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1120,11 +1120,17 @@ <public type="attr" name="smallScreens" /> <public type="attr" name="normalScreens" /> <public type="attr" name="largeScreens" /> + <public type="attr" name="progressBarStyleInverse" /> + <public type="attr" name="progressBarStyleSmallInverse" /> + <public type="attr" name="progressBarStyleLargeInverse" /> <public-padding type="attr" name="donut_resource_pad" end="0x0101029f" /> <public-padding type="id" name="donut_resource_pad" end="0x01020040" /> + <public type="style" name="Widget.ProgressBar.Inverse" id="0x0103005b" /> + <public type="style" name="Widget.ProgressBar.Large.Inverse" id="0x0103005c" /> + <public type="style" name="Widget.ProgressBar.Small.Inverse" id="0x0103005d" /> <public-padding type="style" name="donut_resource_pad" end="0x01030070" /> <public-padding type="string" name="donut_resource_pad" end="0x01040030" /> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 648a7dd..7d235ec 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -243,7 +243,7 @@ <style name="Widget.ProgressBar"> <item name="android:indeterminateOnly">true</item> - <item name="android:indeterminateDrawable">@android:drawable/progress_medium</item> + <item name="android:indeterminateDrawable">@android:drawable/progress_medium_white</item> <item name="android:indeterminateBehavior">repeat</item> <item name="android:indeterminateDuration">3500</item> <item name="android:minWidth">48dip</item> @@ -253,7 +253,7 @@ </style> <style name="Widget.ProgressBar.Large"> - <item name="android:indeterminateDrawable">@android:drawable/progress_large</item> + <item name="android:indeterminateDrawable">@android:drawable/progress_large_white</item> <item name="android:minWidth">76dip</item> <item name="android:maxWidth">76dip</item> <item name="android:minHeight">76dip</item> @@ -261,13 +261,25 @@ </style> <style name="Widget.ProgressBar.Small"> - <item name="android:indeterminateDrawable">@android:drawable/progress_small</item> + <item name="android:indeterminateDrawable">@android:drawable/progress_small_white</item> <item name="android:minWidth">16dip</item> <item name="android:maxWidth">16dip</item> <item name="android:minHeight">16dip</item> <item name="android:maxHeight">16dip</item> </style> + <style name="Widget.ProgressBar.Inverse"> + <item name="android:indeterminateDrawable">@android:drawable/progress_medium</item> + </style> + + <style name="Widget.ProgressBar.Large.Inverse"> + <item name="android:indeterminateDrawable">@android:drawable/progress_large</item> + </style> + + <style name="Widget.ProgressBar.Small.Inverse"> + <item name="android:indeterminateDrawable">@android:drawable/progress_small</item> + </style> + <style name="Widget.ProgressBar.Small.Title"> <item name="android:indeterminateDrawable">@android:drawable/progress_small_titlebar</item> </style> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index f37d514..bd6e1df 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -154,6 +154,9 @@ <item name="progressBarStyleSmall">@android:style/Widget.ProgressBar.Small</item> <item name="progressBarStyleSmallTitle">@android:style/Widget.ProgressBar.Small.Title</item> <item name="progressBarStyleLarge">@android:style/Widget.ProgressBar.Large</item> + <item name="progressBarStyleInverse">@android:style/Widget.ProgressBar.Inverse</item> + <item name="progressBarStyleSmallInverse">@android:style/Widget.ProgressBar.Small.Inverse</item> + <item name="progressBarStyleLargeInverse">@android:style/Widget.ProgressBar.Large.Inverse</item> <item name="seekBarStyle">@android:style/Widget.SeekBar</item> <item name="ratingBarStyle">@android:style/Widget.RatingBar</item> <item name="ratingBarStyleIndicator">@android:style/Widget.RatingBar.Indicator</item> @@ -233,6 +236,13 @@ <item name="listViewStyle">@android:style/Widget.ListView.White</item> <item name="listDivider">@drawable/divider_horizontal_bright</item> <item name="listSeparatorTextViewStyle">@android:style/Widget.TextView.ListSeparator.White</item> + + <item name="progressBarStyle">@android:style/Widget.ProgressBar.Inverse</item> + <item name="progressBarStyleSmall">@android:style/Widget.ProgressBar.Small.Inverse</item> + <item name="progressBarStyleLarge">@android:style/Widget.ProgressBar.Large.Inverse</item> + <item name="progressBarStyleInverse">@android:style/Widget.ProgressBar</item> + <item name="progressBarStyleSmallInverse">@android:style/Widget.ProgressBar.Small</item> + <item name="progressBarStyleLargeInverse">@android:style/Widget.ProgressBar.Large</item> </style> <!-- Variant of the light theme with no title bar --> |
