[FRP] Add illustration to lock screen setup

Added the illustration JPG files, and added
SetupWizardUtils.setIllustration method that will change the
illustrations in the layout.

Bug: 18482708
Change-Id: I8c6758113f07cd33f85eaf6bc019e8194d9a17ce
This commit is contained in:
Maurice Lam
2014-12-03 16:12:31 -08:00
parent a3dff74e59
commit 1227a19ecc
35 changed files with 84 additions and 43 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

View File

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

View File

@@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -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>

View File

@@ -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" />

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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>

View File

@@ -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">

View File

@@ -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());
}

View File

@@ -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());
}

View File

@@ -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());
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}
}
}