diff options
author | Maurice Lam <yukl@google.com> | 2014-08-15 20:29:32 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-15 18:50:14 +0000 |
commit | cd93d141302ee374285d5a8dcd97bc7ab61298cc (patch) | |
tree | b9a90640424829f4532ba40414de559f9586a8da /src | |
parent | fad2b09db8cf65478db35f9a8265c948ccffeabc (diff) | |
parent | 8d449a0e36a56af9e87f960a5dd05b398e7d4faf (diff) | |
download | packages_apps_Settings-cd93d141302ee374285d5a8dcd97bc7ab61298cc.zip packages_apps_Settings-cd93d141302ee374285d5a8dcd97bc7ab61298cc.tar.gz packages_apps_Settings-cd93d141302ee374285d5a8dcd97bc7ab61298cc.tar.bz2 |
Merge "[WifiSetup] Use framework AutoMirrored" into lmp-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/widget/SetupWizardIllustration.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/settings/widget/SetupWizardIllustration.java b/src/com/android/settings/widget/SetupWizardIllustration.java index 8a9d507..fa8dd80 100644 --- a/src/com/android/settings/widget/SetupWizardIllustration.java +++ b/src/com/android/settings/widget/SetupWizardIllustration.java @@ -22,7 +22,6 @@ import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.util.AttributeSet; -import android.util.LayoutDirection; import android.util.Log; import android.widget.FrameLayout; @@ -46,7 +45,6 @@ public class SetupWizardIllustration extends FrameLayout { private int mForegroundHeight = 0; private float mScale = 1.0f; private float mAspectRatio = 0.0f; - private boolean mAutoMirrored; public SetupWizardIllustration(Context context) { this(context, null); @@ -67,8 +65,6 @@ public class SetupWizardIllustration extends FrameLayout { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SetupWizardIllustration, 0, 0); mAspectRatio = a.getFloat(R.styleable.SetupWizardIllustration_aspectRatio, 0.0f); - // TODO: Use framework autoMirrored supported in drawables instead b/17047609 - mAutoMirrored = a.getBoolean(R.styleable.SetupWizardIllustration_autoMirrored, false); a.recycle(); } // Number of pixels of the 8dp baseline grid as defined in material design specs @@ -95,6 +91,12 @@ public class SetupWizardIllustration extends FrameLayout { } @Override + public void onResolveDrawables(int layoutDirection) { + mBackground.setLayoutDirection(layoutDirection); + mForeground.setLayoutDirection(layoutDirection); + } + + @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (mAspectRatio != 0.0f) { int parentWidth = MeasureSpec.getSize(widthMeasureSpec); @@ -136,10 +138,6 @@ public class SetupWizardIllustration extends FrameLayout { @Override public void onDraw(Canvas canvas) { canvas.save(); - if (mAutoMirrored && getLayoutDirection() == LayoutDirection.RTL) { - canvas.scale(-1, 1); - canvas.translate(-canvas.getWidth(), 0); - } if (mBackground != null) { canvas.save(); // Draw the background filling parts not covered by the illustration |