Skip to content

Commit b858ecd

Browse files
Fabrice Di MeglioAndroid (Google) Code Review
authored andcommitted
Merge "Fix bug #7345139: The First Volume Down Click looses its place on the volume slider" into jb-mr1-dev
2 parents a3d5b68 + f37df1b commit b858ecd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

core/java/android/widget/AbsSeekBar.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ void onProgressRefresh(float scale, boolean fromUser) {
241241

242242
@Override
243243
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
244+
super.onSizeChanged(w, h, oldw, oldh);
244245
updateThumbPos(w, h);
245246
}
246247

@@ -555,4 +556,23 @@ public boolean performAccessibilityAction(int action, Bundle arguments) {
555556
}
556557
return false;
557558
}
559+
560+
@Override
561+
public void onRtlPropertiesChanged(int layoutDirection) {
562+
super.onRtlPropertiesChanged(layoutDirection);
563+
564+
int max = getMax();
565+
float scale = max > 0 ? (float) getProgress() / (float) max : 0;
566+
567+
Drawable thumb = mThumb;
568+
if (thumb != null) {
569+
setThumbPos(getWidth(), thumb, scale, Integer.MIN_VALUE);
570+
/*
571+
* Since we draw translated, the drawable's bounds that it signals
572+
* for invalidation won't be the actual bounds we want invalidated,
573+
* so just invalidate this whole view.
574+
*/
575+
invalidate();
576+
}
577+
}
558578
}

0 commit comments

Comments
 (0)