summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2012-10-16 13:23:36 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-16 13:23:37 -0700
commitb858ecd3a94add574503d4dd21084ad289bc5c27 (patch)
tree969bf05517eae61d8d2ce79f5830d4e7537ebd8a
parenta3d5b688cf500f456127f1c2639ed9323ba50e9c (diff)
parentf37df1b6c23316e3050a399f9218087c4000564a (diff)
downloadframeworks_base-b858ecd3a94add574503d4dd21084ad289bc5c27.zip
frameworks_base-b858ecd3a94add574503d4dd21084ad289bc5c27.tar.gz
frameworks_base-b858ecd3a94add574503d4dd21084ad289bc5c27.tar.bz2
Merge "Fix bug #7345139: The First Volume Down Click looses its place on the volume slider" into jb-mr1-dev
-rw-r--r--core/java/android/widget/AbsSeekBar.java20
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();
+ }
+ }
}