diff options
35 files changed, 84 insertions, 43 deletions
diff --git a/res/drawable-hdpi/setup_illustration_lock_screen.jpg b/res/drawable-hdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..db697a0 --- /dev/null +++ b/res/drawable-hdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-hdpi/setup_illustration_wifi.jpg b/res/drawable-hdpi/setup_illustration_wifi.jpg Binary files differnew file mode 100644 index 0000000..d38551e --- /dev/null +++ b/res/drawable-hdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-mdpi/setup_illustration_lock_screen.jpg b/res/drawable-mdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..95e2b8c --- /dev/null +++ b/res/drawable-mdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-mdpi/setup_illustration_wifi.jpg b/res/drawable-mdpi/setup_illustration_wifi.jpg Binary files differnew file mode 100644 index 0000000..a497bf5 --- /dev/null +++ b/res/drawable-mdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-sw600dp-hdpi/setup_illustration_lock_screen.jpg b/res/drawable-sw600dp-hdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..03cd9d9 --- /dev/null +++ b/res/drawable-sw600dp-hdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-hdpi/setup_illustration_wifi_wide_image.jpg b/res/drawable-sw600dp-hdpi/setup_illustration_wifi.jpg Binary files differindex fccea72..fccea72 100644 --- a/res/drawable-hdpi/setup_illustration_wifi_wide_image.jpg +++ b/res/drawable-sw600dp-hdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-sw600dp-mdpi/setup_illustration_lock_screen.jpg b/res/drawable-sw600dp-mdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..4a7ab38 --- /dev/null +++ b/res/drawable-sw600dp-mdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-mdpi/setup_illustration_wifi_wide_image.jpg b/res/drawable-sw600dp-mdpi/setup_illustration_wifi.jpg Binary files differindex f21dffb..f21dffb 100644 --- a/res/drawable-mdpi/setup_illustration_wifi_wide_image.jpg +++ b/res/drawable-sw600dp-mdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-sw600dp-xhdpi/setup_illustration_lock_screen.jpg b/res/drawable-sw600dp-xhdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..05f7725 --- /dev/null +++ b/res/drawable-sw600dp-xhdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-xhdpi/setup_illustration_wifi_wide_image.jpg b/res/drawable-sw600dp-xhdpi/setup_illustration_wifi.jpg Binary files differindex 3d1b3f3..3d1b3f3 100644 --- a/res/drawable-xhdpi/setup_illustration_wifi_wide_image.jpg +++ b/res/drawable-sw600dp-xhdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-sw600dp-xxhdpi/setup_illustration_lock_screen.jpg b/res/drawable-sw600dp-xxhdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..da3f7d9 --- /dev/null +++ b/res/drawable-sw600dp-xxhdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-xxhdpi/setup_illustration_wifi_wide_image.jpg b/res/drawable-sw600dp-xxhdpi/setup_illustration_wifi.jpg Binary files differindex 6a590b7..6a590b7 100644 --- a/res/drawable-xxhdpi/setup_illustration_wifi_wide_image.jpg +++ b/res/drawable-sw600dp-xxhdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-sw600dp-xxxhdpi/setup_illustration_lock_screen.jpg b/res/drawable-sw600dp-xxxhdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..fd5da99 --- /dev/null +++ b/res/drawable-sw600dp-xxxhdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-xxxhdpi/setup_illustration_wifi_wide_image.jpg b/res/drawable-sw600dp-xxxhdpi/setup_illustration_wifi.jpg Binary files differindex d6f2f82..d6f2f82 100644 --- a/res/drawable-xxxhdpi/setup_illustration_wifi_wide_image.jpg +++ b/res/drawable-sw600dp-xxxhdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-sw600dp/setup_illustration.xml b/res/drawable-sw600dp/setup_illustration.xml new file mode 100644 index 0000000..c0e54e2 --- /dev/null +++ b/res/drawable-sw600dp/setup_illustration.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<layer-list xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true"> + + <item> + <bitmap android:src="@drawable/setup_illustration_horizontal_tile" + android:gravity="top" + android:tileModeX="repeat" + android:tileModeY="disabled" /> + </item> + + <item android:id="@+id/illustration_image"> + <bitmap android:src="@drawable/setup_illustration_wifi" + android:gravity="top|start" /> + </item> + +</layer-list> diff --git a/res/drawable-xhdpi/setup_illustration_lock_screen.jpg b/res/drawable-xhdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..b6b856e --- /dev/null +++ b/res/drawable-xhdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-xhdpi/setup_illustration_wifi.jpg b/res/drawable-xhdpi/setup_illustration_wifi.jpg Binary files differnew file mode 100644 index 0000000..a399c19 --- /dev/null +++ b/res/drawable-xhdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-xxhdpi/setup_illustration_lock_screen.jpg b/res/drawable-xxhdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..4cb0c63 --- /dev/null +++ b/res/drawable-xxhdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-nodpi/setup_illustration_wifi_image.jpg b/res/drawable-xxhdpi/setup_illustration_wifi.jpg Binary files differindex a27c93e..a27c93e 100644 --- a/res/drawable-nodpi/setup_illustration_wifi_image.jpg +++ b/res/drawable-xxhdpi/setup_illustration_wifi.jpg diff --git a/res/drawable-xxxhdpi/setup_illustration_lock_screen.jpg b/res/drawable-xxxhdpi/setup_illustration_lock_screen.jpg Binary files differnew file mode 100644 index 0000000..13821f3 --- /dev/null +++ b/res/drawable-xxxhdpi/setup_illustration_lock_screen.jpg diff --git a/res/drawable-xxxhdpi/setup_illustration_wifi.jpg b/res/drawable-xxxhdpi/setup_illustration_wifi.jpg Binary files differnew file mode 100644 index 0000000..56c19b6 --- /dev/null +++ b/res/drawable-xxxhdpi/setup_illustration_wifi.jpg diff --git a/res/drawable/setup_illustration_wifi_wide.xml b/res/drawable/setup_illustration.xml index 33ee2f6..f8d96d5 100644 --- a/res/drawable/setup_illustration_wifi_wide.xml +++ b/res/drawable/setup_illustration.xml @@ -18,16 +18,9 @@ <layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true"> - <item> - <bitmap android:src="@drawable/setup_illustration_horizontal_tile" - android:gravity="top" - android:tileModeX="repeat" - android:tileModeY="disabled" /> - </item> - <item android:id="@+id/illustration_image"> - <bitmap android:src="@drawable/setup_illustration_wifi_wide_image" - android:gravity="top|start" /> + <bitmap android:src="@drawable/setup_illustration_wifi" + android:gravity="fill" /> </item> -</layer-list>
\ No newline at end of file +</layer-list> diff --git a/res/drawable/setup_illustration_wifi.xml b/res/drawable/setup_illustration_wifi.xml deleted file mode 100644 index 9db2f13..0000000 --- a/res/drawable/setup_illustration_wifi.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2014 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<bitmap xmlns:android="http://schemas.android.com/apk/res/android" - android:autoMirrored="true" - android:src="@drawable/setup_illustration_wifi_image" /> diff --git a/res/layout-sw600dp-land/setup_preference.xml b/res/layout-sw600dp-land/setup_preference.xml index 431ac29..814bc91 100644 --- a/res/layout-sw600dp-land/setup_preference.xml +++ b/res/layout-sw600dp-land/setup_preference.xml @@ -22,10 +22,11 @@ android:orientation="vertical"> <com.android.settings.widget.SetupWizardIllustration + android:id="@+id/setup_illustration" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" - android:foreground="@drawable/setup_illustration_wifi_wide" + android:foreground="@drawable/setup_illustration" android:background="@drawable/setup_illustration_bg"> <LinearLayout diff --git a/res/layout-sw600dp-land/setup_template.xml b/res/layout-sw600dp-land/setup_template.xml index 33c31a5..a58dd3d 100644 --- a/res/layout-sw600dp-land/setup_template.xml +++ b/res/layout-sw600dp-land/setup_template.xml @@ -21,12 +21,12 @@ android:orientation="vertical"> <com.android.settings.widget.SetupWizardIllustration - android:id="@+id/illustration_tablet" + android:id="@+id/setup_illustration" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@drawable/setup_illustration_bg" - android:foreground="@drawable/setup_illustration_wifi_wide"> + android:foreground="@drawable/setup_illustration"> <LinearLayout android:layout_width="match_parent" diff --git a/res/layout-sw600dp/setup_preference.xml b/res/layout-sw600dp/setup_preference.xml index 1e772d9..ec6d2ac 100644 --- a/res/layout-sw600dp/setup_preference.xml +++ b/res/layout-sw600dp/setup_preference.xml @@ -21,12 +21,12 @@ android:orientation="vertical"> <com.android.settings.widget.SetupWizardIllustration - android:id="@+id/title_area" + android:id="@+id/setup_illustration" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@drawable/setup_illustration_bg" - android:foreground="@drawable/setup_illustration_wifi_wide"> + android:foreground="@drawable/setup_illustration"> <LinearLayout android:layout_width="match_parent" diff --git a/res/layout-sw600dp/setup_template.xml b/res/layout-sw600dp/setup_template.xml index eb210b7..297e9fb 100644 --- a/res/layout-sw600dp/setup_template.xml +++ b/res/layout-sw600dp/setup_template.xml @@ -21,12 +21,12 @@ android:orientation="vertical"> <com.android.settings.widget.SetupWizardIllustration - android:id="@+id/illustration_tablet" + android:id="@+id/setup_illustration" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@drawable/setup_illustration_bg" - android:foreground="@drawable/setup_illustration_wifi_wide"> + android:foreground="@drawable/setup_illustration"> <LinearLayout android:layout_width="match_parent" diff --git a/res/layout/setup_template.xml b/res/layout/setup_template.xml index 7d8ffc8..0623e25 100644 --- a/res/layout/setup_template.xml +++ b/res/layout/setup_template.xml @@ -35,12 +35,12 @@ android:clipChildren="false"> <com.android.settings.widget.SetupWizardIllustration - android:id="@+id/illustration_phone" + android:id="@+id/setup_illustration" android:layout_width="match_parent" android:layout_height="wrap_content" android:elevation="@dimen/setup_wizard_title_area_elevation" android:background="@drawable/setup_illustration_bg" - android:foreground="@drawable/setup_illustration_wifi" + android:foreground="@drawable/setup_illustration" android:tag="stickyContainer" settings:aspectRatio="2.22"> @@ -58,7 +58,7 @@ android:id="@+id/setup_content" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@id/illustration_phone" + android:layout_below="@id/setup_illustration" android:clipChildren="false"/> </RelativeLayout> diff --git a/res/layout/setup_wizard_header.xml b/res/layout/setup_wizard_header.xml index c38a68d..b030ad1 100644 --- a/res/layout/setup_wizard_header.xml +++ b/res/layout/setup_wizard_header.xml @@ -18,12 +18,12 @@ <com.android.settings.widget.SetupWizardIllustration xmlns:android="http://schemas.android.com/apk/res/android" xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" - android:id="@+id/title_area" + android:id="@+id/setup_illustration" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/setup_illustration_bg" android:elevation="@dimen/setup_wizard_title_area_elevation" - android:foreground="@drawable/setup_illustration_wifi" + android:foreground="@drawable/setup_illustration" android:tag="stickyContainer" settings:aspectRatio="2.22"> diff --git a/src/com/android/settings/SetupChooseLockGeneric.java b/src/com/android/settings/SetupChooseLockGeneric.java index 2894f85..c40e7c1 100644 --- a/src/com/android/settings/SetupChooseLockGeneric.java +++ b/src/com/android/settings/SetupChooseLockGeneric.java @@ -87,6 +87,8 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + SetupWizardUtils.setIllustration(getActivity(), + R.drawable.setup_illustration_lock_screen); SetupWizardUtils.setHeaderText(getActivity(), getActivity().getTitle()); } diff --git a/src/com/android/settings/SetupChooseLockPassword.java b/src/com/android/settings/SetupChooseLockPassword.java index ed6fab4..0e53188 100644 --- a/src/com/android/settings/SetupChooseLockPassword.java +++ b/src/com/android/settings/SetupChooseLockPassword.java @@ -91,6 +91,8 @@ public class SetupChooseLockPassword extends ChooseLockPassword @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + SetupWizardUtils.setIllustration(getActivity(), + R.drawable.setup_illustration_lock_screen); SetupWizardUtils.setHeaderText(getActivity(), getActivity().getTitle()); } diff --git a/src/com/android/settings/SetupChooseLockPattern.java b/src/com/android/settings/SetupChooseLockPattern.java index b44dea1..ccd51fa 100644 --- a/src/com/android/settings/SetupChooseLockPattern.java +++ b/src/com/android/settings/SetupChooseLockPattern.java @@ -89,6 +89,8 @@ public class SetupChooseLockPattern extends ChooseLockPattern @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + SetupWizardUtils.setIllustration(getActivity(), + R.drawable.setup_illustration_lock_screen); SetupWizardUtils.setHeaderText(getActivity(), getActivity().getTitle()); } diff --git a/src/com/android/settings/SetupEncryptionInterstitial.java b/src/com/android/settings/SetupEncryptionInterstitial.java index 53548bd..1e9a463 100644 --- a/src/com/android/settings/SetupEncryptionInterstitial.java +++ b/src/com/android/settings/SetupEncryptionInterstitial.java @@ -96,6 +96,8 @@ public class SetupEncryptionInterstitial extends EncryptionInterstitial @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + SetupWizardUtils.setIllustration(getActivity(), + R.drawable.setup_illustration_lock_screen); SetupWizardUtils.setHeaderText(getActivity(), R.string.encryption_interstitial_header); } } diff --git a/src/com/android/settings/SetupRedactionInterstitial.java b/src/com/android/settings/SetupRedactionInterstitial.java index 96f4dff..453e729 100644 --- a/src/com/android/settings/SetupRedactionInterstitial.java +++ b/src/com/android/settings/SetupRedactionInterstitial.java @@ -22,7 +22,6 @@ import com.android.setupwizard.navigationbar.SetupWizardNavBar; import android.content.Context; import android.content.Intent; import android.content.res.Resources; -import android.graphics.Color; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -96,6 +95,8 @@ public class SetupRedactionInterstitial extends RedactionInterstitial @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + SetupWizardUtils.setIllustration(getActivity(), + R.drawable.setup_illustration_lock_screen); SetupWizardUtils.setHeaderText(getActivity(), R.string.notification_section_header); } } diff --git a/src/com/android/settings/SetupWizardUtils.java b/src/com/android/settings/SetupWizardUtils.java index 0f54e63..3d44125 100644 --- a/src/com/android/settings/SetupWizardUtils.java +++ b/src/com/android/settings/SetupWizardUtils.java @@ -16,12 +16,17 @@ package com.android.settings; +import com.android.settings.widget.SetupWizardIllustration; import com.android.setupwizard.navigationbar.SetupWizardNavBar; import android.app.Activity; import android.content.Intent; import android.graphics.Color; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.graphics.drawable.LayerDrawable; +import android.view.Gravity; import android.view.Window; import android.widget.TextView; @@ -109,4 +114,24 @@ public class SetupWizardUtils { toIntent.putExtra(EXTRA_USE_IMMERSIVE_MODE, fromIntent.getBooleanExtra(EXTRA_USE_IMMERSIVE_MODE, false)); } + + public static void setIllustration(Activity activity, int asset) { + SetupWizardIllustration illustration = + (SetupWizardIllustration) activity.findViewById(R.id.setup_illustration); + if (illustration != null) { + Drawable drawable = activity.getDrawable(R.drawable.setup_illustration); + Drawable newIllustration = activity.getDrawable(asset); + if (drawable instanceof LayerDrawable) { + LayerDrawable layers = (LayerDrawable) drawable; + Drawable oldIllustration = layers.findDrawableByLayerId(R.id.illustration_image); + if (newIllustration instanceof BitmapDrawable + && oldIllustration instanceof BitmapDrawable) { + final int gravity = ((BitmapDrawable) oldIllustration).getGravity(); + ((BitmapDrawable) newIllustration).setGravity(gravity); + } + layers.setDrawableByLayerId(R.id.illustration_image, newIllustration); + illustration.setForeground(layers); + } + } + } } |