diff options
author | Maurice Lam <yukl@google.com> | 2015-04-16 16:40:01 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-16 16:40:01 +0000 |
commit | 9455cc786c9842dae9eb31b1d50b385305a7daaa (patch) | |
tree | 7d25c8eb410ba28d631b451f7fca60a307fc5aef | |
parent | 60e5c1f1a8af2c5d89c38af02ae8646c3b12a0bb (diff) | |
parent | 5e79c37fe4dbe2b9c082b68ea08f4fc76a76d6a8 (diff) | |
download | android_frameworks_opt_setupwizard-9455cc786c9842dae9eb31b1d50b385305a7daaa.tar.gz android_frameworks_opt_setupwizard-9455cc786c9842dae9eb31b1d50b385305a7daaa.tar.bz2 android_frameworks_opt_setupwizard-9455cc786c9842dae9eb31b1d50b385305a7daaa.zip |
am 5e79c37f: [SetupWizardLib] Fix shouldMirrorIllustration NPE
* commit '5e79c37fe4dbe2b9c082b68ea08f4fc76a76d6a8':
[SetupWizardLib] Fix shouldMirrorIllustration NPE
-rw-r--r-- | library/main/src/com/android/setupwizardlib/view/Illustration.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/main/src/com/android/setupwizardlib/view/Illustration.java b/library/main/src/com/android/setupwizardlib/view/Illustration.java index 6f95ca9..91c8a59 100644 --- a/library/main/src/com/android/setupwizardlib/view/Illustration.java +++ b/library/main/src/com/android/setupwizardlib/view/Illustration.java @@ -168,7 +168,7 @@ public class Illustration extends FrameLayout { // Scale the background so its size matches the foreground canvas.scale(mScale, mScale, 0, 0); if (VERSION.SDK_INT > VERSION_CODES.JELLY_BEAN_MR1 && - shouldMirrorIllustration(getLayoutDirection())) { + shouldMirrorDrawable(mBackground, getLayoutDirection())) { // Flip the illustration for RTL layouts canvas.scale(-1, 1); canvas.translate(-mBackground.getBounds().width(), 0); @@ -179,7 +179,7 @@ public class Illustration extends FrameLayout { if (mIllustration != null) { canvas.save(); if (VERSION.SDK_INT > VERSION_CODES.JELLY_BEAN_MR1 && - shouldMirrorIllustration(getLayoutDirection())) { + shouldMirrorDrawable(mIllustration, getLayoutDirection())) { // Flip the illustration for RTL layouts canvas.scale(-1, 1); canvas.translate(-mIllustrationBounds.width(), 0); @@ -191,10 +191,10 @@ public class Illustration extends FrameLayout { super.onDraw(canvas); } - private boolean shouldMirrorIllustration(int layoutDirection) { + private boolean shouldMirrorDrawable(Drawable drawable, int layoutDirection) { if (layoutDirection == LayoutDirection.RTL) { if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) { - return mIllustration.isAutoMirrored(); + return drawable.isAutoMirrored(); } else if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) { final int flags = getContext().getApplicationInfo().flags; return (flags & ApplicationInfo.FLAG_SUPPORTS_RTL) != 0; |