diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2012-10-15 19:10:08 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2012-10-16 11:38:26 -0700 |
commit | f37df1b6c23316e3050a399f9218087c4000564a (patch) | |
tree | 1cf49038f820ee8450d1f4b65646c0c645300afc /core/java | |
parent | 809bb404da66498f1723279542d2a7d1f4512052 (diff) | |
download | frameworks_base-f37df1b6c23316e3050a399f9218087c4000564a.zip frameworks_base-f37df1b6c23316e3050a399f9218087c4000564a.tar.gz frameworks_base-f37df1b6c23316e3050a399f9218087c4000564a.tar.bz2 |
Fix bug #7345139: The First Volume Down Click looses its place on the volume slider
- make SeekBar follow layout direction changes
- also fix onSizeChanged() missing call to super class
Change-Id: Ide036e673c5f104b12e7321648ac027547e04065
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/widget/AbsSeekBar.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java index 646fe7e..3b5e75b 100644 --- a/core/java/android/widget/AbsSeekBar.java +++ b/core/java/android/widget/AbsSeekBar.java @@ -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(); + } + } } |