Skip to content

Commit a79803c

Browse files
committed
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
1 parent 55b039f commit a79803c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/java/android/widget/ProgressBar.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,8 @@ private void updateDrawableBounds(int w, int h) {
937937
int left = 0;
938938

939939
if (mIndeterminateDrawable != null) {
940-
if (mOnlyIndeterminate) {
940+
// Aspect ratio logic does not apply to AnimationDrawables
941+
if (mOnlyIndeterminate && !(mIndeterminateDrawable instanceof AnimationDrawable)) {
941942
// Maintain aspect ratio. Certain kinds of animated drawables
942943
// get very confused otherwise.
943944
final int intrinsicWidth = mIndeterminateDrawable.getIntrinsicWidth();

0 commit comments

Comments
 (0)