summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/main/src/com/android/setupwizardlib/view/Illustration.java8
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;