Skip to content

Commit 253f694

Browse files
chethaaseAndroid (Google) Code Review
authored andcommitted
Merge "Fixed ProgressBar logic for AnimationDrawables"
2 parents 29af074 + a79803c commit 253f694

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)