Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7f7e2ac authored by NoraBora's avatar NoraBora
Browse files

guess default mMaxHeight but allow layout to override this.

without this code, progress bar height gets smaller when thumb gets bigger
in AbsSeekBar.java onSizeChanged().
parent 51207b12
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ public class ProgressBar extends View {
        Drawable drawable = a.getDrawable(R.styleable.ProgressBar_progressDrawable);
        if (drawable != null) {
            drawable = tileify(drawable, false);
            // guess mMaxHeight. but allow XML layout to override this.
            setProgressDrawable(drawable);
        }

@@ -421,6 +422,13 @@ public class ProgressBar extends View {
    public void setProgressDrawable(Drawable d) {
        if (d != null) {
            d.setCallback(this);

            // without this code, progress bar height will be updated.
            int drawableHeight = drawable.getMinimumHeight();
            if (mMaxHeight < drawableHeight) {
                mMaxHeight = drawableHeight;
                requestLayout();
            }
        }
        mProgressDrawable = d;
        if (!mIndeterminate) {