summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/ImageView.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2013-06-24 19:22:25 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2013-08-01 15:15:10 -0700
commit3f5a90b2fbba2a83a8a2c5babd5d466a5e0ad2aa (patch)
tree666fee2554ad0f795380960d425606804e8b7ede /core/java/android/widget/ImageView.java
parent851761574a775c6447ab2393d1ba42568ba08c1b (diff)
downloadframeworks_base-3f5a90b2fbba2a83a8a2c5babd5d466a5e0ad2aa.zip
frameworks_base-3f5a90b2fbba2a83a8a2c5babd5d466a5e0ad2aa.tar.gz
frameworks_base-3f5a90b2fbba2a83a8a2c5babd5d466a5e0ad2aa.tar.bz2
Add automatic Drawable mirroring capability when in RTL layout direction
- default value is "no mirroring" - introduce android:autoMirrored as a new attribute for Drawable, BitmapDrawable, LayerDrawable, StateListDrawable and NinePatchDrawable - setting android:autoMirrored="true" means that the drawable will be mirrored when the layout direction is RTL (right-to-left) - also fix an issue with ImageView drawable layout direction not updated correctly when RTL properties were changed See bug #7034321 Need Drawable RTL support Change-Id: If595ee5106c786f38e786d3a032e182f784a9d97
Diffstat (limited to 'core/java/android/widget/ImageView.java')
-rw-r--r--core/java/android/widget/ImageView.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 33fd8ce..3e53b91 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -732,6 +732,15 @@ public class ImageView extends View {
}
}
+ @Override
+ public void onRtlPropertiesChanged(int layoutDirection) {
+ super.onRtlPropertiesChanged(layoutDirection);
+
+ if (mDrawable != null) {
+ mDrawable.setLayoutDirection(layoutDirection);
+ }
+ }
+
private static final Matrix.ScaleToFit[] sS2FArray = {
Matrix.ScaleToFit.FILL,
Matrix.ScaleToFit.START,