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

Commit b858ecd3 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android (Google) Code Review
Browse files

Merge "Fix bug #7345139: The First Volume Down Click looses its place on the...

Merge "Fix bug #7345139: The First Volume Down Click looses its place on the volume slider" into jb-mr1-dev
parents a3d5b688 f37df1b6
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ public abstract class AbsSeekBar extends ProgressBar {
    
    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        updateThumbPos(w, h);
    }

@@ -555,4 +556,23 @@ public abstract class AbsSeekBar extends ProgressBar {
        }
        return false;
    }

    @Override
    public void onRtlPropertiesChanged(int layoutDirection) {
        super.onRtlPropertiesChanged(layoutDirection);

        int max = getMax();
        float scale = max > 0 ? (float) getProgress() / (float) max : 0;

        Drawable thumb = mThumb;
        if (thumb != null) {
            setThumbPos(getWidth(), thumb, scale, Integer.MIN_VALUE);
            /*
             * Since we draw translated, the drawable's bounds that it signals
             * for invalidation won't be the actual bounds we want invalidated,
             * so just invalidate this whole view.
             */
            invalidate();
        }
    }
}