diff options
author | Maurice Lam <yukl@google.com> | 2014-08-15 02:46:37 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-13 23:16:37 +0000 |
commit | 3d8dd19c85ca94e647245a70df9ca6a9c039b7de (patch) | |
tree | 26a2d6ad7654fe924e7163ea860e749a1a1f37c7 | |
parent | bbce34d9be421effb055fbf1a945ec49dfeef02d (diff) | |
parent | d650726b44ebbe8360a6b5b551116c22d0ea10af (diff) | |
download | packages_apps_Settings-3d8dd19c85ca94e647245a70df9ca6a9c039b7de.tar.gz packages_apps_Settings-3d8dd19c85ca94e647245a70df9ca6a9c039b7de.tar.bz2 packages_apps_Settings-3d8dd19c85ca94e647245a70df9ca6a9c039b7de.zip |
Merge "[WifiSetup] Update illustrations" into lmp-dev
-rw-r--r-- | res/drawable-nodpi/grass_tile.jpg | bin | 9702 -> 0 bytes | |||
-rw-r--r-- | res/drawable-nodpi/illustration_wifi.jpg | bin | 58441 -> 0 bytes | |||
-rw-r--r-- | res/drawable-nodpi/illustration_wifi_wide.jpg | bin | 145718 -> 0 bytes | |||
-rw-r--r-- | res/drawable-nodpi/setup_illustration_tile.png | bin | 0 -> 8001 bytes | |||
-rw-r--r-- | res/drawable-nodpi/setup_illustration_wifi.jpg | bin | 0 -> 41685 bytes | |||
-rw-r--r-- | res/drawable-nodpi/setup_illustration_wifi_wide.jpg | bin | 0 -> 20316 bytes | |||
-rw-r--r-- | res/drawable/setup_illustration_bg.xml (renamed from res/drawable/grass.xml) | 2 | ||||
-rw-r--r-- | res/layout-land/setup_preference.xml | 2 | ||||
-rw-r--r-- | res/layout-sw600dp-land/setup_preference.xml | 6 | ||||
-rw-r--r-- | res/layout/setup_wizard_header.xml | 7 | ||||
-rw-r--r-- | res/values/attrs.xml | 1 | ||||
-rw-r--r-- | src/com/android/settings/widget/SetupWizardIllustration.java | 10 |
12 files changed, 21 insertions, 7 deletions
diff --git a/res/drawable-nodpi/grass_tile.jpg b/res/drawable-nodpi/grass_tile.jpg Binary files differdeleted file mode 100644 index 7aef32cc7..000000000 --- a/res/drawable-nodpi/grass_tile.jpg +++ /dev/null diff --git a/res/drawable-nodpi/illustration_wifi.jpg b/res/drawable-nodpi/illustration_wifi.jpg Binary files differdeleted file mode 100644 index 0c03199eb..000000000 --- a/res/drawable-nodpi/illustration_wifi.jpg +++ /dev/null diff --git a/res/drawable-nodpi/illustration_wifi_wide.jpg b/res/drawable-nodpi/illustration_wifi_wide.jpg Binary files differdeleted file mode 100644 index 722fdfd1f..000000000 --- a/res/drawable-nodpi/illustration_wifi_wide.jpg +++ /dev/null diff --git a/res/drawable-nodpi/setup_illustration_tile.png b/res/drawable-nodpi/setup_illustration_tile.png Binary files differnew file mode 100644 index 000000000..ae6d2449a --- /dev/null +++ b/res/drawable-nodpi/setup_illustration_tile.png diff --git a/res/drawable-nodpi/setup_illustration_wifi.jpg b/res/drawable-nodpi/setup_illustration_wifi.jpg Binary files differnew file mode 100644 index 000000000..257922546 --- /dev/null +++ b/res/drawable-nodpi/setup_illustration_wifi.jpg diff --git a/res/drawable-nodpi/setup_illustration_wifi_wide.jpg b/res/drawable-nodpi/setup_illustration_wifi_wide.jpg Binary files differnew file mode 100644 index 000000000..b876fa610 --- /dev/null +++ b/res/drawable-nodpi/setup_illustration_wifi_wide.jpg diff --git a/res/drawable/grass.xml b/res/drawable/setup_illustration_bg.xml index 2fb5bd9b9..0a229c795 100644 --- a/res/drawable/grass.xml +++ b/res/drawable/setup_illustration_bg.xml @@ -16,5 +16,5 @@ --> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" - android:src="@drawable/grass_tile" + android:src="@drawable/setup_illustration_tile" android:tileMode="repeat" /> diff --git a/res/layout-land/setup_preference.xml b/res/layout-land/setup_preference.xml index e79f5c1d0..b2e1cc75a 100644 --- a/res/layout-land/setup_preference.xml +++ b/res/layout-land/setup_preference.xml @@ -25,7 +25,7 @@ android:id="@+id/title_area" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/grass"> + android:background="@drawable/setup_illustration_bg"> <TextView android:id="@+id/title" diff --git a/res/layout-sw600dp-land/setup_preference.xml b/res/layout-sw600dp-land/setup_preference.xml index 90bd44324..1c3940561 100644 --- a/res/layout-sw600dp-land/setup_preference.xml +++ b/res/layout-sw600dp-land/setup_preference.xml @@ -16,6 +16,7 @@ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" android:id="@+id/fragment" android:layout_width="match_parent" android:layout_height="match_parent" @@ -25,8 +26,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" - android:foreground="@drawable/illustration_wifi_wide" - android:background="@drawable/grass"> + android:foreground="@drawable/setup_illustration_wifi_wide" + android:background="@drawable/setup_illustration_bg" + settings:autoMirrored="true"> <LinearLayout android:layout_width="match_parent" diff --git a/res/layout/setup_wizard_header.xml b/res/layout/setup_wizard_header.xml index ebc23045a..90818cda6 100644 --- a/res/layout/setup_wizard_header.xml +++ b/res/layout/setup_wizard_header.xml @@ -21,10 +21,11 @@ android:id="@+id/title_area" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/grass" - android:foreground="@drawable/illustration_wifi" + android:background="@drawable/setup_illustration_bg" + android:foreground="@drawable/setup_illustration_wifi" android:tag="stickyContainer" - settings:aspectRatio="2.0"> + settings:aspectRatio="2.0" + settings:autoMirrored="true"> <TextView android:id="@+id/title" diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 1fe36d6fb..8d17a28a3 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -24,6 +24,7 @@ <declare-styleable name="SetupWizardIllustration"> <attr name="aspectRatio" format="float" /> + <attr name="autoMirrored" format="boolean" /> </declare-styleable> <declare-styleable name="BatteryHistoryChart"> diff --git a/src/com/android/settings/widget/SetupWizardIllustration.java b/src/com/android/settings/widget/SetupWizardIllustration.java index dcc4c6523..8a9d50714 100644 --- a/src/com/android/settings/widget/SetupWizardIllustration.java +++ b/src/com/android/settings/widget/SetupWizardIllustration.java @@ -22,6 +22,7 @@ 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; @@ -45,6 +46,7 @@ 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); @@ -65,6 +67,8 @@ 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 @@ -131,6 +135,11 @@ 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 @@ -146,6 +155,7 @@ public class SetupWizardIllustration extends FrameLayout { mForeground.draw(canvas); canvas.restore(); } + canvas.restore(); super.onDraw(canvas); } } |