[WifiSetup] Update illustration
Update the illustration assets and make the tablet illustration always 256dp height according to mock. Bug: 17133710 Change-Id: I6d84bbb25a9f443e4eb6bf4c1002d8a1438029ef
BIN
res/drawable-hdpi/setup_illustration_horizontal_tile.jpg
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
res/drawable-hdpi/setup_illustration_tile.jpg
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
res/drawable-hdpi/setup_illustration_wifi_wide_image.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
res/drawable-mdpi/setup_illustration_horizontal_tile.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
res/drawable-mdpi/setup_illustration_tile.jpg
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
res/drawable-mdpi/setup_illustration_wifi_wide_image.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 20 KiB |
BIN
res/drawable-xhdpi/setup_illustration_horizontal_tile.jpg
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
res/drawable-xhdpi/setup_illustration_tile.jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
res/drawable-xhdpi/setup_illustration_wifi_wide_image.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
res/drawable-xxhdpi/setup_illustration_horizontal_tile.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
res/drawable-xxhdpi/setup_illustration_tile.jpg
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
res/drawable-xxhdpi/setup_illustration_wifi_wide_image.jpg
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
res/drawable-xxxhdpi/illustration_tile.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
res/drawable-xxxhdpi/setup_illustration_horizontal_tile.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
res/drawable-xxxhdpi/setup_illustration_wifi_wide_image.jpg
Normal file
After Width: | Height: | Size: 146 KiB |
@@ -15,6 +15,19 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:autoMirrored="true"
|
||||
android:src="@drawable/setup_illustration_wifi_wide_image" />
|
||||
<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" />
|
||||
</item>
|
||||
|
||||
</layer-list>
|
@@ -33,13 +33,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/wifi_setup_wizard_title" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wifi_required_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="6dip"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="@string/wifi_required_info_text"
|
||||
android:visibility="gone" />
|
||||
|
@@ -39,6 +39,7 @@
|
||||
style="@style/SetupCardTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/setup_wizard_tablet_illustration_height"
|
||||
android:layout_weight="6"
|
||||
android:text="@string/wifi_setup_wizard_title"/>
|
||||
|
||||
|
@@ -15,9 +15,7 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
@@ -28,12 +26,12 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/setup_illustration_bg"
|
||||
android:foreground="@drawable/setup_illustration_wifi_wide"
|
||||
settings:aspectRatio="4.0">
|
||||
android:foreground="@drawable/setup_illustration_wifi_wide">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/setup_wizard_tablet_illustration_height"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/setup_wizard_card_port_margin_sides"
|
||||
android:paddingRight="@dimen/setup_wizard_card_port_margin_sides">
|
@@ -45,7 +45,6 @@
|
||||
<!-- Dashboard tile image margin start / end -->
|
||||
<dimen name="dashboard_tile_image_margin_start">12dp</dimen>
|
||||
|
||||
<dimen name="setup_wizard_card_title_margin_top">256dp</dimen>
|
||||
<dimen name="setup_wizard_card_title_padding_end">32dp</dimen>
|
||||
<dimen name="setup_wizard_card_title_padding_start">56dp</dimen>
|
||||
<dimen name="setup_wizard_card_title_padding_top">24dp</dimen>
|
||||
|
@@ -50,7 +50,7 @@
|
||||
<dimen name="setup_add_network_item_height">56dp</dimen>
|
||||
<dimen name="setup_wizard_card_corner_radius">2dp</dimen>
|
||||
<dimen name="setup_wizard_card_elevation">5dp</dimen>
|
||||
<dimen name="setup_wizard_card_title_margin_top">0dp</dimen>
|
||||
<dimen name="setup_wizard_tablet_illustration_height">256dp</dimen>
|
||||
<dimen name="setup_wizard_card_title_padding_end">0dp</dimen>
|
||||
<dimen name="setup_wizard_card_title_padding_start">0dp</dimen>
|
||||
<dimen name="setup_wizard_card_title_padding_top">16dp</dimen>
|
||||
|
@@ -176,7 +176,6 @@
|
||||
|
||||
<!-- Alternate title style used for some tablet layouts -->
|
||||
<style name="SetupCardTitle">
|
||||
<item name="android:layout_marginTop">@dimen/setup_wizard_card_title_margin_top</item>
|
||||
<item name="android:paddingBottom">@dimen/setup_wizard_card_title_padding_bottom</item>
|
||||
<item name="android:paddingEnd">@dimen/setup_wizard_card_title_padding_end</item>
|
||||
<item name="android:paddingStart">@dimen/setup_wizard_card_title_padding_start</item>
|
||||
|
@@ -20,9 +20,11 @@ package com.android.settings.widget;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -42,7 +44,8 @@ public class SetupWizardIllustration extends FrameLayout {
|
||||
private float mBaselineGridSize;
|
||||
private Drawable mBackground;
|
||||
private Drawable mForeground;
|
||||
private int mForegroundHeight = 0;
|
||||
private final Rect mViewBounds = new Rect();
|
||||
private final Rect mForegroundBounds = new Rect();
|
||||
private float mScale = 1.0f;
|
||||
private float mAspectRatio = 0.0f;
|
||||
|
||||
@@ -112,36 +115,35 @@ public class SetupWizardIllustration extends FrameLayout {
|
||||
final int layoutWidth = right - left;
|
||||
final int layoutHeight = bottom - top;
|
||||
if (mForeground != null) {
|
||||
final float intrinsicWidth = mForeground.getIntrinsicWidth();
|
||||
final float intrinsicHeight = mForeground.getIntrinsicHeight();
|
||||
if (intrinsicWidth <= 0 || intrinsicHeight <= 0) {
|
||||
Log.e(TAG, "Foreground drawable intrinsic size must be defined and positive");
|
||||
mForeground = null;
|
||||
mForegroundHeight = 0;
|
||||
mScale = 1.0f;
|
||||
} else {
|
||||
// Scale the foreground to fill the width of the view
|
||||
mScale = layoutWidth / intrinsicWidth;
|
||||
mForegroundHeight = (int) (intrinsicHeight * mScale);
|
||||
mForeground.setBounds(0, 0, layoutWidth, mForegroundHeight);
|
||||
int intrinsicWidth = mForeground.getIntrinsicWidth();
|
||||
int intrinsicHeight = mForeground.getIntrinsicHeight();
|
||||
final int layoutDirection = getLayoutDirection();
|
||||
|
||||
mViewBounds.set(0, 0, layoutWidth, layoutHeight);
|
||||
if (mAspectRatio != 0f) {
|
||||
mScale = layoutWidth / (float) intrinsicWidth;
|
||||
intrinsicWidth = layoutWidth;
|
||||
intrinsicHeight = (int) (intrinsicHeight * mScale);
|
||||
}
|
||||
Gravity.apply(Gravity.FILL_HORIZONTAL | Gravity.TOP, intrinsicWidth, intrinsicHeight,
|
||||
mViewBounds, mForegroundBounds, layoutDirection);
|
||||
mForeground.setBounds(mForegroundBounds);
|
||||
}
|
||||
if (mBackground != null) {
|
||||
// Scale the bounds by mScale to compensate for the scale done to the canvas before
|
||||
// drawing.
|
||||
mBackground.setBounds(0, 0, (int) Math.ceil(layoutWidth / mScale),
|
||||
(int) Math.ceil((layoutHeight - mForegroundHeight) / mScale));
|
||||
(int) Math.ceil((layoutHeight - mForegroundBounds.height()) / mScale));
|
||||
}
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas canvas) {
|
||||
canvas.save();
|
||||
if (mBackground != null) {
|
||||
canvas.save();
|
||||
// Draw the background filling parts not covered by the illustration
|
||||
canvas.translate(0, mForegroundHeight);
|
||||
canvas.translate(0, mForegroundBounds.height());
|
||||
// Scale the background so its size matches the foreground
|
||||
canvas.scale(mScale, mScale, 0, 0);
|
||||
mBackground.draw(canvas);
|
||||
@@ -153,7 +155,6 @@ public class SetupWizardIllustration extends FrameLayout {
|
||||
mForeground.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
canvas.restore();
|
||||
super.onDraw(canvas);
|
||||
}
|
||||
}
|
||||
|