Skip to content

Commit 8d21bdb

Browse files
author
Romain Guy
committed
Fix the build.
1 parent a7f7e2a commit 8d21bdb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/java/android/widget/ProgressBar.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ public ProgressBar(Context context, AttributeSet attrs, int defStyle) {
177177
Drawable drawable = a.getDrawable(R.styleable.ProgressBar_progressDrawable);
178178
if (drawable != null) {
179179
drawable = tileify(drawable, false);
180-
// guess mMaxHeight. but allow XML layout to override this.
180+
// Calling this method can set mMaxHeight, make sure the corresponding
181+
// XML attribute for mMaxHeight is read after calling this method
181182
setProgressDrawable(drawable);
182183
}
183184

@@ -423,8 +424,8 @@ public void setProgressDrawable(Drawable d) {
423424
if (d != null) {
424425
d.setCallback(this);
425426

426-
// without this code, progress bar height will be updated.
427-
int drawableHeight = drawable.getMinimumHeight();
427+
// Make sure the ProgressBar is always tall enough
428+
int drawableHeight = d.getMinimumHeight();
428429
if (mMaxHeight < drawableHeight) {
429430
mMaxHeight = drawableHeight;
430431
requestLayout();

0 commit comments

Comments
 (0)