summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chet Haase <chet@google.com> 2011-09-28 17:51:53 -0700
committer Chet Haase <chet@google.com> 2011-09-28 17:51:53 -0700
commita79803c0924836053a6f97cc0e73f7ad56f763bd (patch)
tree261b49adbbbeb63a52d946c7a54cc3d30acc77f1
parent55b039f1b7ecb0439e095082e82c4d4fa2627921 (diff)
Fixed ProgressBar logic for AnimationDrawables
There are problems in ICS using custom ProgressBar indeterminate drawables when those drawables are AnimationDrawables. Code that determines appropriate aspect-ratio sizing should not kick in for this case; the animation drawables know what size they should be. Change-Id: I7c35e0dc0f2719f698551f197c688e6156a3f5bd
-rw-r--r--core/java/android/widget/ProgressBar.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index e033d2d0558f..df88fecc0618 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -937,7 +937,8 @@ public class ProgressBar extends View {
int left = 0;
if (mIndeterminateDrawable != null) {
- if (mOnlyIndeterminate) {
+ // Aspect ratio logic does not apply to AnimationDrawables
+ if (mOnlyIndeterminate && !(mIndeterminateDrawable instanceof AnimationDrawable)) {
// Maintain aspect ratio. Certain kinds of animated drawables
// get very confused otherwise.
final int intrinsicWidth = mIndeterminateDrawable.getIntrinsicWidth();