From a79803c0924836053a6f97cc0e73f7ad56f763bd Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Wed, 28 Sep 2011 17:51:53 -0700 Subject: [PATCH] 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 --- core/java/android/widget/ProgressBar.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java index e033d2d0558fb..df88fecc0618a 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();