Merge "Store an empty theme object on first visit" into ub-launcher3-qt-dev
diff --git a/res/drawable/ic_close_24px.xml b/res/drawable/ic_close_24px.xml
index d5cdfab..aacd703 100644
--- a/res/drawable/ic_close_24px.xml
+++ b/res/drawable/ic_close_24px.xml
@@ -2,9 +2,8 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
- android:viewportHeight="24"
- android:tint="@color/toolbar_icon_color">
+ android:viewportHeight="24">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41z"/>
</vector>
diff --git a/res/drawable/ic_colorize_24px.xml b/res/drawable/ic_colorize_24px.xml
index 6c9f320..fb70972 100644
--- a/res/drawable/ic_colorize_24px.xml
+++ b/res/drawable/ic_colorize_24px.xml
@@ -19,6 +19,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M17.67,3c-0.26,0 -0.51,0.1 -0.71,0.29l-3.12,3.12L11.91,4.5L10.5,5.91l1.42,1.42L3,16.25V21h4.75l8.92,-8.92l1.42,1.42l1.41,-1.41l-1.92,-1.92l3.12,-3.12c0.4,-0.4 0.4,-1.03 0.01,-1.42l-2.34,-2.34C18.17,3.1 17.92,3 17.67,3L17.67,3zM6.92,19H5v-1.92l8.06,-8.06l1.92,1.92L6.92,19L6.92,19z"/>
</vector>
diff --git a/res/drawable/ic_delete_24px.xml b/res/drawable/ic_delete_24px.xml
index 5e4bdae..bc83f36 100644
--- a/res/drawable/ic_delete_24px.xml
+++ b/res/drawable/ic_delete_24px.xml
@@ -17,15 +17,14 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
- android:viewportHeight="24"
- android:tint="@color/toolbar_icon_color">
+ android:viewportHeight="24">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M15,4V3H9v1H4v2h1v13c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V6h1V4H15zM17,19H7V6h10V19z"/>
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M9,8h2v9h-2z"/>
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M13,8h2v9h-2z"/>
</vector>
diff --git a/res/drawable/ic_font.xml b/res/drawable/ic_font.xml
index 7309815..f5df7ba 100644
--- a/res/drawable/ic_font.xml
+++ b/res/drawable/ic_font.xml
@@ -20,10 +20,10 @@
android:viewportHeight="24">
<!-- This path represents a square with rounded corners -->
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M20,2H4C2.9,2 2,2.9 2,4v16c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V4C22,2.9 21.1,2 20,2zM20,20H4V4h16V20z"/>
<!-- This path represents a letter "A" inside the square -->
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M10.69,6h2.6l4.51,12h-2.5l-1.01,-2.87H9.7L8.7,18H6.2L10.69,6zM13.56,13.06l-1.06,-3.02L12.07,8.6h-0.13l-0.44,1.44l-1.07,3.02H13.56z"/>
</vector>
diff --git a/res/drawable/ic_nav_clock.xml b/res/drawable/ic_nav_clock.xml
index 5544a0e..3584976 100644
--- a/res/drawable/ic_nav_clock.xml
+++ b/res/drawable/ic_nav_clock.xml
@@ -21,10 +21,10 @@
android:viewportHeight="24">
<!-- This path corresponds to the outside circle -->
<path
- android:fillColor="@color/bottom_nav_item_color"
+ android:fillColor="@android:color/white"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12c0,5.52 4.47,10 9.99,10C17.52,22 22,17.52 22,12C22,6.48 17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8c0,-4.42 3.58,-8 8,-8s8,3.58 8,8C20,16.42 16.42,20 12,20z"/>
<!-- This draws two lines at an angle representing the clock hands -->
<path
- android:fillColor="@color/bottom_nav_item_color"
+ android:fillColor="@android:color/white"
android:pathData="M16.49,16.36l-5.49,-3.29l0,-6.65l2,0l0,5.51l4.51,2.71z"/>
</vector>
diff --git a/res/drawable/ic_nav_grid.xml b/res/drawable/ic_nav_grid.xml
index 61f0088..027662d 100644
--- a/res/drawable/ic_nav_grid.xml
+++ b/res/drawable/ic_nav_grid.xml
@@ -20,6 +20,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="@color/bottom_nav_item_color"
+ android:fillColor="@android:color/white"
android:pathData="M22,7V5h-3V2h-2v3h-4V2h-2v3H7V2H5v3H2v2h3v4H2v2h3v4H2v2h3v3h2v-3h4v3h2v-3h4v3h2v-3h3v-2h-3v-4h3v-2h-3V7H22zM7,7h4v4H7V7zM7,17v-4h4v4H7zM17,17h-4v-4h4V17zM17,11h-4V7h4V11z"/>
</vector>
diff --git a/res/drawable/ic_nav_theme.xml b/res/drawable/ic_nav_theme.xml
index 6d388c9..fcda980 100644
--- a/res/drawable/ic_nav_theme.xml
+++ b/res/drawable/ic_nav_theme.xml
@@ -20,6 +20,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="@color/bottom_nav_item_color"
+ android:fillColor="@android:color/white"
android:pathData="M4,2v9c0,1.65 1.35,3 3,3h2v6c0,1.1 0.9,2 2,2h2c1.1,0 2,-0.9 2,-2v-6h2c1.65,0 3,-1.35 3,-3V2C20,2 4,2 4,2zM11,20v-6h2v6H11zM18,11c0,0.55 -0.45,1 -1,1h-2H9H7c-0.55,0 -1,-0.45 -1,-1v-0.93h12V11zM18,8.07H6V4h2.81v2.15h2V4h2.38v2.15h2V4H18V8.07z"/>
</vector>
diff --git a/res/drawable/ic_nav_wallpaper.xml b/res/drawable/ic_nav_wallpaper.xml
index 96ebe10..c935666 100644
--- a/res/drawable/ic_nav_wallpaper.xml
+++ b/res/drawable/ic_nav_wallpaper.xml
@@ -20,6 +20,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="@color/bottom_nav_item_color"
+ android:fillColor="@android:color/white"
android:pathData="M9,12.71l2.14,2.58l3,-3.87L18,16.57H6L9,12.71zM5,5h6V3H5C3.9,3 3,3.9 3,5v6h2V5zM19,19h-6v2h6c1.1,0 2,-0.9 2,-2v-6h-2V19zM5,19v-6H3v6c0,1.1 0.9,2 2,2h6v-2H5zM19,5v6h2V5c0,-1.1 -0.9,-2 -2,-2h-6v2H19zM16,9c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1c-0.55,0 -1,0.45 -1,1S15.45,9 16,9z"/>
</vector>
diff --git a/res/drawable/ic_shapes_24px.xml b/res/drawable/ic_shapes_24px.xml
index d2838d2..525f757 100644
--- a/res/drawable/ic_shapes_24px.xml
+++ b/res/drawable/ic_shapes_24px.xml
@@ -19,6 +19,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M22,11v9c0,1.1 -0.9,2 -2,2H10c-1.1,0 -2,-0.9 -2,-2v-2.19h0.06c0.67,0 1.32,-0.08 1.94,-0.22V20h10v-9h-3.41c0.14,-0.63 0.22,-1.27 0.22,-1.94V9H20C21.1,9 22,9.9 22,11zM8.06,4C5.27,4 3,6.27 3,9.06s2.27,5.06 5.06,5.06s5.06,-2.27 5.06,-5.06C13.12,6.27 10.85,4 8.06,4M8.06,2c3.9,0 7.06,3.16 7.06,7.06s-3.16,7.06 -7.06,7.06S1,12.96 1,9.06S4.16,2 8.06,2z"/>
</vector>
diff --git a/res/drawable/ic_tune.xml b/res/drawable/ic_tune.xml
index a6dd634..a310d56 100644
--- a/res/drawable/ic_tune.xml
+++ b/res/drawable/ic_tune.xml
@@ -19,6 +19,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M3,17v2h6v-2H3zM3,5v2h10V5H3zM13,21v-2h8v-2h-8v-2h-2v6H13zM7,9v2H3v2h4v2h2V9H7zM21,13v-2H11v2H21zM15,9h2V7h4V5h-4V3h-2V9z"/>
</vector>
diff --git a/res/drawable/ic_wallpaper_24px.xml b/res/drawable/ic_wallpaper_24px.xml
deleted file mode 100644
index 737b309..0000000
--- a/res/drawable/ic_wallpaper_24px.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- Copyright (C) 2019 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:fillColor="#FF000000"
- android:pathData="M9,12.71l2.14,2.58l3,-3.87L18,16.57H6L9,12.71zM5,5h6V3H5C3.9,3 3,3.9 3,5v6h2V5zM19,19h-6v2h6c1.1,0 2,-0.9 2,-2v-6h-2V19zM5,19v-6H3v6c0,1.1 0.9,2 2,2h6v-2H5zM19,5v6h2V5c0,-1.1 -0.9,-2 -2,-2h-6v2H19zM16,9c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1c-0.55,0 -1,0.45 -1,1S15.45,9 16,9z"/>
-</vector>
diff --git a/res/drawable/ic_wifi_24px.xml b/res/drawable/ic_wifi_24px.xml
index cf44585..0e27c57 100644
--- a/res/drawable/ic_wifi_24px.xml
+++ b/res/drawable/ic_wifi_24px.xml
@@ -19,6 +19,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FF000000"
+ android:fillColor="@android:color/white"
android:pathData="M1,9l2,2c4.97,-4.97 13.03,-4.97 18,0l2,-2C16.93,2.93 7.08,2.93 1,9zM9,17l3,3l3,-3C13.35,15.34 10.66,15.34 9,17zM5,13l2,2c2.76,-2.76 7.24,-2.76 10,0l2,-2C15.14,9.14 8.87,9.14 5,13z"/>
</vector>
diff --git a/res/layout/preview_card_color_content.xml b/res/layout/preview_card_color_content.xml
index 156a74d..8587652 100644
--- a/res/layout/preview_card_color_content.xml
+++ b/res/layout/preview_card_color_content.xml
@@ -16,13 +16,11 @@
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="200dp"
- android:layout_height="200dp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_gravity="center"
- android:gravity="center_horizontal|bottom"
- android:orientation="vertical"
- tools:showIn="@layout/theme_preview_card">
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -31,56 +29,72 @@
android:orientation="horizontal">
<FrameLayout
android:layout_width="@dimen/preview_theme_icon_size"
- android:layout_height="@dimen/preview_theme_icon_size">
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1">
<ImageView
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_gravity="center"
android:id="@+id/preview_color_qs_0_bg"/>
<ImageView
android:layout_width="@dimen/preview_theme_tile_size"
android:layout_height="@dimen/preview_theme_tile_size"
+ android:layout_gravity="center"
android:id="@+id/preview_color_qs_0_icon"
- android:tint="@color/tile_enabled_icon_color"
- android:layout_gravity="center"/>
+ android:tint="@color/tile_enabled_icon_color"/>
</FrameLayout>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
<FrameLayout
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
- android:layout_marginHorizontal="28dp">
+ android:layout_weight="1">
<ImageView
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_gravity="center"
android:id="@+id/preview_color_qs_1_bg"/>
<ImageView
android:layout_width="@dimen/preview_theme_tile_size"
android:layout_height="@dimen/preview_theme_tile_size"
+ android:layout_gravity="center"
android:id="@+id/preview_color_qs_1_icon"
- android:tint="@color/tile_enabled_icon_color"
- android:layout_gravity="center"/>
+ android:tint="@color/tile_enabled_icon_color"/>
</FrameLayout>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
<FrameLayout
android:layout_width="@dimen/preview_theme_icon_size"
- android:layout_height="@dimen/preview_theme_icon_size">
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1">
<ImageView
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_gravity="center"
android:id="@+id/preview_color_qs_2_bg"
android:tint="@color/tile_disabled_background_color"/>
<ImageView
android:layout_width="@dimen/preview_theme_tile_size"
android:layout_height="@dimen/preview_theme_tile_size"
+ android:layout_gravity="center"
android:id="@+id/preview_color_qs_2_icon"
- android:color="@color/tile_disabled_icon_color"
- android:layout_gravity="center"/>
+ android:color="@color/tile_disabled_icon_color"/>
</FrameLayout>
</LinearLayout>
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="horizontal"
- android:layout_marginTop="30dp"
- android:gravity="center|bottom">
+ android:gravity="center">
<SeekBar
android:id="@+id/preview_seekbar"
android:layout_height="wrap_content"
@@ -91,63 +105,63 @@
android:clickable="true"
android:max="3"/>
</LinearLayout>
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
- android:layout_marginTop="15dp"
android:gravity="center"
android:orientation="horizontal">
- <CheckBox
- android:id="@+id/preview_check_selected"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:checked="true"
- android:layout_gravity="center"
- android:enabled="false"/>
- <RadioButton
- android:id="@+id/preview_radio_selected"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="30dp"
- android:layout_marginRight="22dp"
- android:checked="true"
- android:layout_gravity="center"
- android:enabled="false"/>
- <Switch
- android:id="@+id/preview_toggle_selected"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:checked="true"
- android:layout_gravity="center"
- android:enabled="false"/>
+ <FrameLayout
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1">
+ <CheckBox
+ android:id="@+id/preview_check_selected"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:checked="true"
+ android:enabled="false"/>
+ </FrameLayout>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
+ <FrameLayout
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1">
+ <RadioButton
+ android:id="@+id/preview_radio_selected"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:checked="true"
+ android:enabled="false"/>
+ </FrameLayout>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
+ <FrameLayout
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1">
+ <Switch
+ android:id="@+id/preview_toggle_selected"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:checked="true"
+ android:enabled="false"/>
+ </FrameLayout>
</LinearLayout>
- <LinearLayout
+ <Space
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:layout_marginTop="20dp"
- android:gravity="center"
- android:orientation="horizontal">
- <CheckBox
- android:id="@+id/preview_check_unselected"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:enabled="false"/>
- <RadioButton
- android:id="@+id/preview_radio_unselected"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="30dp"
- android:layout_marginRight="22dp"
- android:layout_gravity="center"
- android:enabled="false"/>
- <Switch
- android:id="@+id/preview_toggle_unselected"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:enabled="false"/>
- </LinearLayout>
+ android:layout_height="0dp"
+ android:layout_weight="1" />
</LinearLayout>
diff --git a/res/layout/preview_card_cover_content.xml b/res/layout/preview_card_cover_content.xml
index aa20204..d052642 100644
--- a/res/layout/preview_card_cover_content.xml
+++ b/res/layout/preview_card_cover_content.xml
@@ -14,94 +14,104 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout
+<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
+ android:layout_marginHorizontal="@dimen/preview_theme_cover_content_extra_margin"
android:gravity="center_horizontal"
- android:orientation="vertical"
tools:showIn="@layout/theme_preview_card">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="0"
- android:layout_marginBottom="24dp"
- android:gravity="center|bottom"
- android:orientation="horizontal">
- <FrameLayout
- android:layout_width="@dimen/preview_theme_icon_size"
- android:layout_height="@dimen/preview_theme_icon_size"
- android:layout_marginLeft="6dp">
- <ImageView
- android:layout_width="@dimen/preview_theme_icon_size"
- android:layout_height="@dimen/preview_theme_icon_size"
- android:id="@+id/preview_color_qs_0_bg"/>
- <ImageView
- android:layout_width="@dimen/preview_theme_tile_size"
- android:layout_height="@dimen/preview_theme_tile_size"
- android:id="@+id/preview_color_qs_0_icon"
- android:tint="@color/tile_enabled_icon_color"
- android:layout_gravity="center"/>
- </FrameLayout>
- <FrameLayout
- android:layout_width="@dimen/preview_theme_icon_size"
- android:layout_height="@dimen/preview_theme_icon_size"
- android:layout_marginHorizontal="50dp">
- <ImageView
- android:layout_width="@dimen/preview_theme_icon_size"
- android:layout_height="@dimen/preview_theme_icon_size"
- android:id="@+id/preview_color_qs_1_bg"/>
- <ImageView
- android:layout_width="@dimen/preview_theme_tile_size"
- android:layout_height="@dimen/preview_theme_tile_size"
- android:id="@+id/preview_color_qs_1_icon"
- android:tint="@color/tile_enabled_icon_color"
- android:layout_gravity="center"/>
- </FrameLayout>
- <FrameLayout
- android:layout_width="@dimen/preview_theme_icon_size"
- android:layout_height="@dimen/preview_theme_icon_size"
- android:layout_marginRight="6dp">
- <ImageView
- android:layout_width="@dimen/preview_theme_icon_size"
- android:layout_height="@dimen/preview_theme_icon_size"
- android:id="@+id/preview_color_qs_2_bg"
- android:tint="@color/tile_disabled_background_color"/>
- <ImageView
- android:layout_width="@dimen/preview_theme_tile_size"
- android:layout_height="@dimen/preview_theme_tile_size"
- android:id="@+id/preview_color_qs_2_icon"
- android:color="@color/tile_disabled_icon_color"
- android:layout_gravity="center"/>
- </FrameLayout>
- </LinearLayout>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:orientation="horizontal">
+ <FrameLayout
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_marginLeft="6dp"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true">
<ImageView
- android:id="@+id/shape_preview_icon_0"
- android:layout_width="@dimen/preview_theme_shape_size"
- android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_marginVertical="4dp"
- android:elevation="4dp"/>
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:id="@+id/preview_color_qs_0_bg"/>
+ <ImageView
+ android:layout_width="@dimen/preview_theme_tile_size"
+ android:layout_height="@dimen/preview_theme_tile_size"
+ android:id="@+id/preview_color_qs_0_icon"
+ android:tint="@color/tile_enabled_icon_color"
+ android:layout_gravity="center"/>
+ </FrameLayout>
+ <FrameLayout
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"
+ android:layout_gravity="center_horizontal">
+ <ImageView
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_gravity="center"
+ android:id="@+id/preview_color_qs_1_bg"/>
+ <ImageView
+ android:layout_width="@dimen/preview_theme_tile_size"
+ android:layout_height="@dimen/preview_theme_tile_size"
+ android:id="@+id/preview_color_qs_1_icon"
+ android:tint="@color/tile_enabled_icon_color"
+ android:layout_gravity="center"/>
+ </FrameLayout>
+ <FrameLayout
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_marginRight="6dp"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true">
+ <ImageView
+ android:layout_width="@dimen/preview_theme_icon_size"
+ android:layout_height="@dimen/preview_theme_icon_size"
+ android:id="@+id/preview_color_qs_2_bg"
+ android:tint="@color/tile_disabled_background_color"/>
+ <ImageView
+ android:layout_width="@dimen/preview_theme_tile_size"
+ android:layout_height="@dimen/preview_theme_tile_size"
+ android:id="@+id/preview_color_qs_2_icon"
+ android:color="@color/tile_disabled_icon_color"
+ android:layout_gravity="center"/>
+ </FrameLayout>
+
+ <ImageView
+ android:id="@+id/shape_preview_icon_0"
+ android:layout_width="@dimen/preview_theme_shape_size"
+ android:layout_height="@dimen/preview_theme_shape_size"
+ android:layout_marginVertical="4dp"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:elevation="4dp"/>
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_centerHorizontal="true">
<ImageView
android:id="@+id/shape_preview_icon_1"
android:layout_width="@dimen/preview_theme_shape_size"
android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_marginHorizontal="38dp"
+ android:layout_gravity="center_horizontal"
android:layout_marginVertical="4dp"
android:elevation="4dp"/>
- <ImageView
- android:id="@+id/shape_preview_icon_2"
- android:layout_width="@dimen/preview_theme_shape_size"
- android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_marginVertical="4dp"
- android:layout_marginRight="2dp"
- android:elevation="4dp"/>
- </LinearLayout>
- <include layout="@layout/theme_cover_qsb"/>
-</LinearLayout>
\ No newline at end of file
+ </FrameLayout>
+ <ImageView
+ android:id="@+id/shape_preview_icon_2"
+ android:layout_width="@dimen/preview_theme_shape_size"
+ android:layout_height="@dimen/preview_theme_shape_size"
+ android:layout_marginVertical="4dp"
+ android:layout_marginRight="2dp"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true"
+ android:elevation="4dp"/>
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true">
+ <include layout="@layout/theme_cover_qsb"/>
+ </FrameLayout>
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/preview_card_font_content.xml b/res/layout/preview_card_font_content.xml
index d52474e..2a27b01 100644
--- a/res/layout/preview_card_font_content.xml
+++ b/res/layout/preview_card_font_content.xml
@@ -17,7 +17,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center_horizontal"
@@ -28,14 +28,13 @@
android:id="@+id/font_card_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
android:gravity="center_horizontal"
android:text="@string/font_card_title"/>
<View
android:id="@+id/font_card_divider"
android:layout_width="15dp"
android:layout_height="2dp"
- android:layout_marginVertical="30dp"
+ android:layout_marginVertical="@dimen/font_preview_divider_gap"
android:background="?android:colorAccent"/>
<TextView
style="@style/FontCardBodyTextStyle"
diff --git a/res/layout/preview_card_icon_content.xml b/res/layout/preview_card_icon_content.xml
index 260d212..ce40c48 100644
--- a/res/layout/preview_card_icon_content.xml
+++ b/res/layout/preview_card_icon_content.xml
@@ -16,56 +16,81 @@
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="200dp"
- android:layout_height="136dp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center_horizontal"
- android:orientation="vertical"
- tools:showIn="@layout/theme_preview_card">
+ android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:id="@+id/preview_icon_0"
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1"
android:tint="@color/theme_preview_icon_color"/>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
<ImageView
android:id="@+id/preview_icon_1"
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
- android:layout_marginHorizontal="40dp"
+ android:layout_weight="1"
android:tint="@color/theme_preview_icon_color"/>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
<ImageView
android:id="@+id/preview_icon_2"
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1"
android:tint="@color/theme_preview_icon_color"/>
</LinearLayout>
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:gravity="bottom"
+ android:layout_height="wrap_content"
+ android:gravity="bottom|center_horizontal"
android:orientation="horizontal">
<ImageView
android:id="@+id/preview_icon_3"
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1"
android:tint="@color/theme_preview_icon_color"/>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
<ImageView
android:id="@+id/preview_icon_4"
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
- android:layout_marginHorizontal="40dp"
+ android:layout_weight="1"
android:tint="@color/theme_preview_icon_color"/>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
<ImageView
android:id="@+id/preview_icon_5"
android:layout_width="@dimen/preview_theme_icon_size"
android:layout_height="@dimen/preview_theme_icon_size"
+ android:layout_weight="1"
android:tint="@color/theme_preview_icon_color"/>
</LinearLayout>
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/preview_card_shape_content.xml b/res/layout/preview_card_shape_content.xml
index 8013214..67d3526 100644
--- a/res/layout/preview_card_shape_content.xml
+++ b/res/layout/preview_card_shape_content.xml
@@ -16,63 +16,117 @@
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="wrap_content"
- android:layout_height="152dp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center_horizontal"
- android:orientation="vertical"
- tools:showIn="@layout/theme_preview_card">
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:orientation="horizontal">
- <ImageView
- android:id="@+id/shape_preview_icon_0"
- android:layout_width="@dimen/preview_theme_shape_size"
- android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_margin="4dp"
- android:elevation="4dp"/>
- <ImageView
- android:id="@+id/shape_preview_icon_1"
- android:layout_width="@dimen/preview_theme_shape_size"
- android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_marginHorizontal="22dp"
- android:layout_marginVertical="4dp"
- android:elevation="4dp"/>
- <ImageView
- android:id="@+id/shape_preview_icon_2"
- android:layout_width="@dimen/preview_theme_shape_size"
- android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_margin="4dp"
- android:elevation="4dp"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_marginBottom="5dp"
- android:layout_weight="1"
- android:gravity="bottom"
- android:orientation="horizontal">
- <ImageView
- android:id="@+id/shape_preview_icon_3"
- android:layout_width="@dimen/preview_theme_shape_size"
- android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_margin="4dp"
- android:elevation="4dp"/>
- <ImageView
- android:id="@+id/shape_preview_icon_4"
- android:layout_width="@dimen/preview_theme_shape_size"
- android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_marginHorizontal="22dp"
- android:layout_marginVertical="4dp"
- android:elevation="4dp"/>
- <ImageView
- android:id="@+id/shape_preview_icon_5"
- android:layout_width="@dimen/preview_theme_shape_size"
- android:layout_height="@dimen/preview_theme_shape_size"
- android:layout_margin="4dp"
- android:elevation="4dp"/>
- </LinearLayout>
+ android:orientation="vertical">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
+ android:orientation="horizontal">
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <ImageView
+ android:id="@+id/shape_preview_icon_0"
+ android:layout_width="@dimen/preview_theme_shape_size"
+ android:layout_height="@dimen/preview_theme_shape_size"
+ android:layout_gravity="center_horizontal"
+ android:layout_margin="4dp"
+ android:elevation="4dp"/>
+ </FrameLayout>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <ImageView
+ android:id="@+id/shape_preview_icon_1"
+ android:layout_width="@dimen/preview_theme_shape_size"
+ android:layout_height="@dimen/preview_theme_shape_size"
+ android:layout_gravity="center_horizontal"
+ android:layout_margin="4dp"
+ android:elevation="4dp"/>
+ </FrameLayout>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <ImageView
+ android:id="@+id/shape_preview_icon_2"
+ android:layout_width="@dimen/preview_theme_shape_size"
+ android:layout_height="@dimen/preview_theme_shape_size"
+ android:layout_gravity="center_horizontal"
+ android:layout_margin="4dp"
+ android:elevation="4dp"/>
+ </FrameLayout>
+ </LinearLayout>
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="bottom|center_horizontal"
+ android:orientation="horizontal">
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <ImageView
+ android:id="@+id/shape_preview_icon_3"
+ android:layout_width="@dimen/preview_theme_shape_size"
+ android:layout_height="@dimen/preview_theme_shape_size"
+ android:layout_gravity="center_horizontal"
+ android:layout_margin="4dp"
+ android:elevation="4dp"/>
+ </FrameLayout>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <ImageView
+ android:id="@+id/shape_preview_icon_4"
+ android:layout_width="@dimen/preview_theme_shape_size"
+ android:layout_height="@dimen/preview_theme_shape_size"
+ android:layout_gravity="center_horizontal"
+ android:layout_margin="4dp"
+ android:elevation="4dp"/>
+ </FrameLayout>
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0" />
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <ImageView
+ android:id="@+id/shape_preview_icon_5"
+ android:layout_width="@dimen/preview_theme_shape_size"
+ android:layout_height="@dimen/preview_theme_shape_size"
+ android:layout_margin="4dp"
+ android:layout_gravity="center_horizontal"
+ android:elevation="4dp"/>
+ </FrameLayout>
+ </LinearLayout>
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/theme_preview_card.xml b/res/layout/theme_preview_card.xml
index d8cb8a9..451ee7c 100644
--- a/res/layout/theme_preview_card.xml
+++ b/res/layout/theme_preview_card.xml
@@ -29,51 +29,89 @@
android:layout_height="match_parent"
android:focusable="true">
- <LinearLayout
+ <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingTop="@dimen/preview_card_padding"
android:paddingHorizontal="@dimen/preview_card_padding"
- android:orientation="vertical">
+ android:paddingTop="@dimen/preview_card_padding"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent">
<ViewStub
android:id="@+id/theme_preview_top_bar"
- android:layout="@layout/theme_preview_topbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="20dp"/>
+ android:layout="@layout/theme_preview_topbar"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"/>
- <TextView
+ <TextView
android:id="@+id/theme_preview_card_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
- android:drawablePadding="10dp"
- android:textAppearance="@style/CardTitleTextAppearance"/>
+ android:layout_marginVertical="@dimen/card_header_top_margin"
+ android:drawablePadding="12dp"
+ android:textAppearance="@style/CardTitleTextAppearance"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/theme_preview_top_bar"
+ app:layout_goneMarginTop="@dimen/card_header_top_margin"/>
<Space
- android:layout_width="match_parent"
+ android:id="@+id/theme_preview_content_spacer"
+ android:layout_width="0dp"
android:layout_height="0dp"
- android:layout_weight="1" />
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHeight_max="48dp"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/theme_preview_card_header"/>
<FrameLayout
android:id="@+id/theme_preview_card_body_container"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="0dp"
android:layout_marginHorizontal="8dp"
- android:layout_weight="1"/>
+ android:layout_marginTop="@dimen/preview_theme_content_margin"
+ app:layout_constraintBottom_toTopOf="@+id/guideline"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHeight_max="@dimen/preview_theme_content_max_height"
+ app:layout_constraintHeight_min="@dimen/preview_theme_content_min_height"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/theme_preview_content_spacer">
+
+ </FrameLayout>
+
+ <androidx.constraintlayout.widget.Guideline
+ android:id="@+id/guideline"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ app:layout_constraintGuide_end="40dp"
+ />
<TextView
android:id="@+id/edit_label"
+ style="@style/EditLabelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
android:drawableStart="@drawable/ic_tune"
android:drawablePadding="8dp"
android:gravity="center"
android:text="@string/edit_custom_theme_lbl"
- style="@style/EditLabelStyle"
- android:visibility="invisible"/>
- </LinearLayout>
+ android:visibility="invisible"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/theme_preview_card_body_container"
+ app:layout_constraintVertical_bias="0.5"/>
+
+ </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
diff --git a/res/layout/theme_preview_topbar.xml b/res/layout/theme_preview_topbar.xml
index 1977e47..2422064 100644
--- a/res/layout/theme_preview_topbar.xml
+++ b/res/layout/theme_preview_topbar.xml
@@ -17,6 +17,7 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/theme_preview_top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:visibility="visible" tools:showIn="@layout/theme_preview_card">
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index ecb78be..4b16b5e 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -16,10 +16,23 @@
limitations under the License.
-->
<resources>
+ <dimen name="card_title_text_size">12sp</dimen>
+ <dimen name="card_cover_title_text_size">16sp</dimen>
+ <dimen name="card_header_top_margin">8dp</dimen>
+ <dimen name="preview_card_padding">8dp</dimen>
<dimen name="preview_page_gap">93dp</dimen>
<dimen name="preview_page_horizontal_margin">92dp</dimen>
+ <dimen name="preview_theme_content_margin">18dp</dimen>
+ <dimen name="preview_theme_content_max_height">140dp</dimen>
+ <dimen name="preview_theme_content_min_height">100dp</dimen>
+ <dimen name="preview_theme_cover_topbar_icon_size">14dp</dimen>
+ <dimen name="preview_theme_icon_size">28dp</dimen>
+ <dimen name="preview_theme_tile_size">14dp</dimen>
+ <dimen name="preview_theme_shape_size">32dp</dimen>
+ <dimen name="preview_theme_cover_content_extra_margin">0dp</dimen>
+
+ <dimen name="font_preview_divider_gap">12dp</dimen>
<dimen name="options_container_width">400dp</dimen>
-
<dimen name="option_bottom_margin">8dp</dimen>
</resources>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 121a23f..6ccf9bf 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -27,7 +27,6 @@
<dimen name="preview_indicator_width">16dp</dimen>
<dimen name="preview_indicator_height">8dp</dimen>
<dimen name="indicator_container_height">48dp</dimen>
- <dimen name="indicator_container_divider_height">1dp</dimen>
<dimen name="indicator_arrow_size">24dp</dimen>
<dimen name="indicator_arrow_touch_area_size">48dp</dimen>
@@ -50,7 +49,6 @@
<dimen name="theme_option_font_sample_width">52dp</dimen>
<dimen name="theme_option_sample_padding">5dp</dimen>
<!-- Note, using dp instead of sp as this is just the "+" symbol, not text -->
- <dimen name="theme_option_add_size">32dp</dimen>
<dimen name="option_tile_padding_vertical">12dp</dimen>
<dimen name="option_tile_padding_horizontal">10dp</dimen>
@@ -62,21 +60,22 @@
<dimen name="option_tile_margin_horizontal">2dp</dimen>
<dimen name="theme_option_label_margin">4dp</dimen>
- <dimen name="preview_card_corner_radius">8dp</dimen>
- <dimen name="preview_card_padding">16dp</dimen>
+ <dimen name="preview_card_padding">20dp</dimen>
<dimen name="card_title_text_size">16sp</dimen>
<dimen name="card_cover_title_text_size">24sp</dimen>
+ <dimen name="card_header_top_margin">16dp</dimen>
+ <dimen name="preview_theme_content_margin">40dp</dimen>
+ <dimen name="preview_theme_content_max_height">192dp</dimen>
+ <dimen name="preview_theme_content_min_height">152dp</dimen>
<dimen name="preview_theme_icon_size">40dp</dimen>
<dimen name="preview_theme_tile_size">20dp</dimen>
<dimen name="preview_theme_shape_size">52dp</dimen>
<dimen name="preview_theme_cover_topbar_icon_size">20dp</dimen>
+ <dimen name="preview_theme_cover_content_extra_margin">8dp</dimen>
- <dimen name="color_preview_image_width">182dp</dimen>
- <dimen name="color_preview_image_height">194dp</dimen>
-
- <dimen name="shape_preview_image_width">236dp</dimen>
- <dimen name="shape_preview_image_height">153dp</dimen>
+ <dimen name="font_preview_body_width">200dp</dimen>
+ <dimen name="font_preview_divider_gap">30dp</dimen>
<dimen name="custom_theme_nav_height">56dp</dimen>
diff --git a/res/values/override.xml b/res/values/override.xml
index 9b7ea96..818f357 100644
--- a/res/values/override.xml
+++ b/res/values/override.xml
@@ -17,7 +17,6 @@
-->
<resources>
<string name="themes_stub_package" translatable="false"/>
- <string name="clocks_stub_package" translatable="false"/>
<!-- Authority of a provider in System UI that will provide preview info for available clockfaces. -->
<string name="clocks_provider_authority" translatable="false">com.android.keyguard.clock</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 75bd9a6..cae42ce 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -57,6 +57,9 @@
<!-- Content description of the previous button to bring user to the previous preview page. [CHAR LIMIT=NONE] -->
<string name="previous_page_content_description">Previous</string>
+ <!-- Content description indicating that the selected option is currently applied to the device. [CHAR_LIMIT=NONE] -->
+ <string name="option_applied_description"><xliff:g name="style_name">%1$s</xliff:g>, currently applied</string>
+
<!-- Sample text used to show a preview of a selected font [CHAR LIMIT=3] -->
<string name="theme_font_example">ABC</string>
@@ -64,7 +67,6 @@
<string name="theme_description">Font: <xliff:g name="font_name">%1$s</xliff:g>, icons: <xliff:g name="icon_name">%2$s</xliff:g>, shape: <xliff:g name="shape_name">%3$s</xliff:g>, color: <xliff:g name="color_name">%4$s</xliff:g> </string>
<!-- Plus sign used to indicate that the user can add a custom theme -->
- <string name="add_custom_theme" translatable="false">+</string>
<!-- Name for the Android Theme that comes preset with the device [CHAR LIMIT=10]-->
<string name="default_theme_title">Default</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index a907769..5009155 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -96,14 +96,13 @@
</style>
<style name="FontCardBodyTextStyle">
- <item name="android:layout_width">200dp</item>
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:maxWidth">@dimen/font_preview_body_width</item>
<item name="android:textAlignment">center</item>
<item name="android:textAppearance">@android:style/TextAppearance.DeviceDefault</item>
</style>
- <style name="ComponentCounterTextAppearance" parent="@android:style/TextAppearance.DeviceDefault"/>
-
- <style name="EditLabelStyle" parent="@style/ActionSecondaryButton">
+ <style name="EditLabelStyle">
<item name="android:textAppearance">@android:style/TextAppearance.DeviceDefault</item>
</style>
</resources>
diff --git a/robolectric_tests/res/values/overlayable_icons_test.xml b/robolectric_tests/res/values/overlayable_icons_test.xml
new file mode 100644
index 0000000..73cffe1
--- /dev/null
+++ b/robolectric_tests/res/values/overlayable_icons_test.xml
@@ -0,0 +1,34 @@
+<!--
+ Copyright (C) 2019 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.
+-->
+<resources>
+ <!-- overlayable_icons references all of the drawables in this package
+ that are being overlayed by resource overlays. If you remove/rename
+ any of these resources, you must also change the resource overlay icons.-->
+ <array name="overlayable_icons">
+ <item>@drawable/ic_add_24px</item>
+ <item>@drawable/ic_close_24px</item>
+ <item>@drawable/ic_colorize_24px</item>
+ <item>@drawable/ic_delete_24px</item>
+ <item>@drawable/ic_font</item>
+ <item>@drawable/ic_nav_clock</item>
+ <item>@drawable/ic_nav_grid</item>
+ <item>@drawable/ic_nav_theme</item>
+ <item>@drawable/ic_nav_wallpaper</item>
+ <item>@drawable/ic_shapes_24px</item>
+ <item>@drawable/ic_tune</item>
+ <item>@drawable/ic_wifi_24px</item>
+ </array>
+</resources>
diff --git a/robolectric_tests/src/com/android/customization/model/theme/ThemeManagerTest.java b/robolectric_tests/src/com/android/customization/model/theme/ThemeManagerTest.java
index 185f632..24bf4ab 100644
--- a/robolectric_tests/src/com/android/customization/model/theme/ThemeManagerTest.java
+++ b/robolectric_tests/src/com/android/customization/model/theme/ThemeManagerTest.java
@@ -30,14 +30,10 @@
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertFalse;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import android.app.Activity;
import android.provider.Settings;
import androidx.annotation.Nullable;
@@ -45,7 +41,6 @@
import com.android.customization.model.CustomizationManager.Callback;
import com.android.customization.module.ThemesUserEventLogger;
-import com.android.customization.testutils.Condition;
import com.android.customization.testutils.OverlayManagerMocks;
import com.android.customization.testutils.Wait;
import com.android.wallpaper.module.WallpaperSetter;
@@ -59,8 +54,6 @@
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
-import java.util.Map;
-
@RunWith(RobolectricTestRunner.class)
public class ThemeManagerTest {
@@ -102,13 +95,12 @@
OVERLAY_CATEGORY_ICON_SETTINGS, true, 0);
mMockOmHelper.addOverlay("test.package.name_sysui", SYSUI_PACKAGE,
OVERLAY_CATEGORY_ICON_SYSUI, true, 0);
+ mMockOmHelper.addOverlay("test.package.name_themepicker", ,
+ OVERLAY_CATEGORY_ICON_SYSUI, true, 0);
ThemeBundle defaultTheme = new ThemeBundle.Builder().asDefault().build(mActivity);
- applyThemeAndWaitForCondition(defaultTheme, "Overlays didn't get disabled", () -> {
- verify(mMockOm, times(6)).disableOverlay(anyString(), anyInt());
- return true;
- });
+ applyTheme(defaultTheme);
assertEquals("Secure Setting should be emtpy after applying default theme",
"",
@@ -133,42 +125,22 @@
.addOverlayPackage(OVERLAY_CATEGORY_FONT, bundleFontPackage)
.build(mActivity);
- applyThemeAndWaitForCondition(theme, "Overlays didn't get enabled", () -> {
- verify(mMockOm, times(2)).setEnabledExclusiveInCategory(anyString(), anyInt());
- Map<String, String> overlays = mMockOm.getEnabledOverlaysForTargets(ANDROID_PACKAGE);
- assertEquals(2, overlays.size());
- assertTrue(bundleColorPackage + " should be enabled",
- overlays.values().contains(bundleColorPackage));
- assertTrue(bundleFontPackage + " should be enabled",
- overlays.values().contains(bundleFontPackage));
- assertFalse(otherPackage + " should not be enabled",
- overlays.values().contains(otherPackage));
- return true;
- });
+ applyTheme(theme);
assertEquals("Secure Setting was not properly set after applying theme",
theme.getSerializedPackages(),
Settings.Secure.getString(mActivity.getContentResolver(), THEME_SETTING));
}
- private void applyThemeAndWaitForCondition(ThemeBundle theme, String message,
- Condition condition) {
- boolean[] done = {false, false};
+ private void applyTheme(ThemeBundle theme) {
mThemeManager.apply(theme, new Callback() {
@Override
public void onSuccess() {
- done[0] = true;
}
@Override
public void onError(@Nullable Throwable throwable) {
- done[0] = true;
- done[1] = true;
}
});
- // TODO: refactor these tests so we can get rid of the long wait.
- Wait.atMost(message, () -> done[0] && condition.isTrue(), 1000);
- // done[1] is only set to true in the onError callback.
- assertFalse(done[1]);
}
}
diff --git a/src/com/android/customization/model/ResourceConstants.java b/src/com/android/customization/model/ResourceConstants.java
index f2bccfc..be3b548 100644
--- a/src/com/android/customization/model/ResourceConstants.java
+++ b/src/com/android/customization/model/ResourceConstants.java
@@ -64,6 +64,7 @@
String OVERLAY_CATEGORY_ICON_SETTINGS = "android.theme.customization.icon_pack.settings";
String OVERLAY_CATEGORY_ICON_SYSUI = "android.theme.customization.icon_pack.systemui";
String OVERLAY_CATEGORY_ICON_LAUNCHER = "android.theme.customization.icon_pack.launcher";
+ String OVERLAY_CATEGORY_ICON_THEMEPICKER = "android.theme.customization.icon_pack.themepicker";
/**
* Global Android theme category (default theme prebundled with the OS)
@@ -96,6 +97,7 @@
sTargetPackages.addAll(Arrays.asList(ANDROID_PACKAGE, SETTINGS_PACKAGE,
SYSUI_PACKAGE));
sTargetPackages.add(getLauncherPackage(context));
+ sTargetPackages.add(context.getPackageName());
}
return sTargetPackages.toArray(new String[0]);
}
diff --git a/src/com/android/customization/model/theme/DefaultThemeProvider.java b/src/com/android/customization/model/theme/DefaultThemeProvider.java
index e282cbd..ac32312 100644
--- a/src/com/android/customization/model/theme/DefaultThemeProvider.java
+++ b/src/com/android/customization/model/theme/DefaultThemeProvider.java
@@ -27,6 +27,7 @@
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_LAUNCHER;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SETTINGS;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SYSUI;
+import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_THEMEPICKER;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SHAPE;
import static com.android.customization.model.ResourceConstants.SETTINGS_PACKAGE;
import static com.android.customization.model.ResourceConstants.SYSUI_PACKAGE;
@@ -89,6 +90,7 @@
private static final String SHAPE_PREFIX = "theme_overlay_shape_";
private static final String ICON_ANDROID_PREFIX = "theme_overlay_icon_android_";
private static final String ICON_LAUNCHER_PREFIX = "theme_overlay_icon_launcher_";
+ private static final String ICON_THEMEPICKER_PREFIX = "theme_overlay_icon_themepicker_";
private static final String ICON_SETTINGS_PREFIX = "theme_overlay_icon_settings_";
private static final String ICON_SYSUI_PREFIX = "theme_overlay_icon_sysui_";
private static final String WALLPAPER_PREFIX = "theme_wallpaper_";
@@ -117,7 +119,8 @@
om.getOverlayInfosForTarget(ANDROID_PACKAGE, user).forEach(addToMap);
om.getOverlayInfosForTarget(SYSUI_PACKAGE, user).forEach(addToMap);
om.getOverlayInfosForTarget(SETTINGS_PACKAGE, user).forEach(addToMap);
- om.getOverlayInfosForTarget(ResourceConstants.getLauncherPackage(context),user).forEach(addToMap);
+ om.getOverlayInfosForTarget(ResourceConstants.getLauncherPackage(context), user).forEach(addToMap);
+ om.getOverlayInfosForTarget(context.getPackageName(), user).forEach(addToMap);
mShapePreviewIconPackages = context.getResources().getStringArray(
R.array.icon_shape_preview_packages);
}
@@ -170,7 +173,11 @@
String iconLauncherOverlayPackage = getOverlayPackage(ICON_LAUNCHER_PREFIX,
themeName);
- addNoPreviewIconOverlay(builder,iconLauncherOverlayPackage);
+ addNoPreviewIconOverlay(builder, iconLauncherOverlayPackage);
+
+ String iconThemePickerOverlayPackage = getOverlayPackage(ICON_THEMEPICKER_PREFIX,
+ themeName);
+ addNoPreviewIconOverlay(builder, iconThemePickerOverlayPackage);
String iconSettingsOverlayPackage = getOverlayPackage(ICON_SETTINGS_PREFIX,
themeName);
@@ -512,6 +519,7 @@
addSysUiIconOverlay(builder, customPackages.get(OVERLAY_CATEGORY_ICON_SYSUI));
addNoPreviewIconOverlay(builder, customPackages.get(OVERLAY_CATEGORY_ICON_SETTINGS));
addNoPreviewIconOverlay(builder, customPackages.get(OVERLAY_CATEGORY_ICON_LAUNCHER));
+ addNoPreviewIconOverlay(builder, customPackages.get(OVERLAY_CATEGORY_ICON_THEMEPICKER));
return builder;
} catch (JSONException | NameNotFoundException | NotFoundException e) {
diff --git a/src/com/android/customization/model/theme/ThemeManager.java b/src/com/android/customization/model/theme/ThemeManager.java
index 96a159f..d873972 100644
--- a/src/com/android/customization/model/theme/ThemeManager.java
+++ b/src/com/android/customization/model/theme/ThemeManager.java
@@ -15,16 +15,14 @@
*/
package com.android.customization.model.theme;
-import static com.android.customization.model.ResourceConstants.ANDROID_PACKAGE;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_COLOR;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_FONT;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_ANDROID;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_LAUNCHER;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SETTINGS;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SYSUI;
+import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_THEMEPICKER;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SHAPE;
-import static com.android.customization.model.ResourceConstants.SETTINGS_PACKAGE;
-import static com.android.customization.model.ResourceConstants.SYSUI_PACKAGE;
import android.graphics.Point;
import android.provider.Settings;
@@ -61,6 +59,7 @@
THEME_CATEGORIES.add(OVERLAY_CATEGORY_ICON_SETTINGS);
THEME_CATEGORIES.add(OVERLAY_CATEGORY_ICON_SYSUI);
THEME_CATEGORIES.add(OVERLAY_CATEGORY_ICON_LAUNCHER);
+ THEME_CATEGORIES.add(OVERLAY_CATEGORY_ICON_THEMEPICKER);
};
@@ -163,30 +162,7 @@
}
private void applyOverlays(ThemeBundle theme, Callback callback) {
- boolean allApplied = true;
- if (theme.isDefault()) {
- allApplied &= disableCurrentOverlay(ANDROID_PACKAGE, OVERLAY_CATEGORY_SHAPE);
- allApplied &= disableCurrentOverlay(ANDROID_PACKAGE, OVERLAY_CATEGORY_COLOR);
- allApplied &= disableCurrentOverlay(ANDROID_PACKAGE, OVERLAY_CATEGORY_FONT);
- allApplied &= disableCurrentOverlay(ANDROID_PACKAGE, OVERLAY_CATEGORY_ICON_ANDROID);
- allApplied &= disableCurrentOverlay(SYSUI_PACKAGE, OVERLAY_CATEGORY_ICON_SYSUI);
- allApplied &= disableCurrentOverlay(SETTINGS_PACKAGE, OVERLAY_CATEGORY_ICON_SETTINGS);
- allApplied &= disableCurrentOverlay(ResourceConstants.getLauncherPackage(mActivity),
- OVERLAY_CATEGORY_ICON_LAUNCHER);
- } else {
- allApplied &= applyOverlayOrDefault(theme, ANDROID_PACKAGE, OVERLAY_CATEGORY_SHAPE);
- allApplied &= applyOverlayOrDefault(theme, ANDROID_PACKAGE, OVERLAY_CATEGORY_COLOR);
- allApplied &= applyOverlayOrDefault(theme, ANDROID_PACKAGE, OVERLAY_CATEGORY_FONT);
- allApplied &= applyOverlayOrDefault(theme, ANDROID_PACKAGE,
- OVERLAY_CATEGORY_ICON_ANDROID);
- allApplied &= applyOverlayOrDefault(theme, SYSUI_PACKAGE, OVERLAY_CATEGORY_ICON_SYSUI);
- allApplied &= applyOverlayOrDefault(theme, SETTINGS_PACKAGE,
- OVERLAY_CATEGORY_ICON_SETTINGS);
- allApplied &= applyOverlayOrDefault(theme,
- ResourceConstants.getLauncherPackage(mActivity),
- OVERLAY_CATEGORY_ICON_LAUNCHER);
- }
- allApplied &= Settings.Secure.putString(mActivity.getContentResolver(),
+ boolean allApplied = Settings.Secure.putString(mActivity.getContentResolver(),
ResourceConstants.THEME_SETTING, theme.getSerializedPackages());
if (theme instanceof CustomTheme) {
storeCustomTheme((CustomTheme) theme);
@@ -209,14 +185,6 @@
mProvider.fetch(callback, reload);
}
- private boolean disableCurrentOverlay(String targetPackage, String category) {
- return true;
- }
-
- private boolean applyOverlayOrDefault(ThemeBundle theme, String targetPkg, String category) {
- return true;
- }
-
public Map<String, String> getCurrentOverlays() {
if (mCurrentOverlays == null) {
mCurrentOverlays = mOverlayManagerCompat.getEnabledOverlaysForTargets(
diff --git a/src/com/android/customization/model/theme/custom/IconOptionsProvider.java b/src/com/android/customization/model/theme/custom/IconOptionsProvider.java
index 2319387..b977764 100644
--- a/src/com/android/customization/model/theme/custom/IconOptionsProvider.java
+++ b/src/com/android/customization/model/theme/custom/IconOptionsProvider.java
@@ -21,6 +21,7 @@
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_LAUNCHER;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SETTINGS;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_SYSUI;
+import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_THEMEPICKER;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -51,6 +52,7 @@
private final List<String> mSysUiIconsOverlayPackages = new ArrayList<>();
private final List<String> mSettingsIconsOverlayPackages = new ArrayList<>();
private final List<String> mLauncherIconsOverlayPackages = new ArrayList<>();
+ private final List<String> mThemePickerIconsOverlayPackages = new ArrayList<>();
public IconOptionsProvider(Context context, OverlayManagerCompat manager) {
super(context, manager, OVERLAY_CATEGORY_ICON_ANDROID);
@@ -61,6 +63,8 @@
OVERLAY_CATEGORY_ICON_SETTINGS, UserHandle.myUserId(), targetPackages));
mLauncherIconsOverlayPackages.addAll(manager.getOverlayPackagesForCategory(
OVERLAY_CATEGORY_ICON_LAUNCHER, UserHandle.myUserId(), targetPackages));
+ mThemePickerIconsOverlayPackages.addAll(manager.getOverlayPackagesForCategory(
+ OVERLAY_CATEGORY_ICON_THEMEPICKER, UserHandle.myUserId(), targetPackages));
}
@Override
@@ -93,6 +97,10 @@
addOrUpdateOption(optionsByPrefix, overlayPackage, OVERLAY_CATEGORY_ICON_LAUNCHER);
}
+ for (String overlayPackage : mThemePickerIconsOverlayPackages) {
+ addOrUpdateOption(optionsByPrefix, overlayPackage, OVERLAY_CATEGORY_ICON_THEMEPICKER);
+ }
+
for (IconOption option : optionsByPrefix.values()) {
if (option.isValid(mContext)) {
mOptions.add(option);
diff --git a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
index 9427208..d148746 100644
--- a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
+++ b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
@@ -230,8 +230,7 @@
*/
private static int[] COLOR_BUTTON_IDS = {
R.id.preview_check_selected, R.id.preview_radio_selected,
- R.id.preview_toggle_selected, R.id.preview_check_unselected,
- R.id.preview_radio_unselected, R.id.preview_toggle_unselected
+ R.id.preview_toggle_selected
};
@ColorInt private int mColorAccentLight;
@@ -318,14 +317,6 @@
enabledSwitch.setThumbTintList(tintList);
enabledSwitch.setTrackTintList(tintList);
- Switch disabledSwitch = container.findViewById(R.id.preview_toggle_unselected);
- disabledSwitch.setThumbTintList(
- ColorStateList.valueOf(res.getColor(R.color.switch_thumb_tint)));
- disabledSwitch.setTrackTintList(
- ColorStateList.valueOf(res.getColor(R.color.switch_track_tint)));
- // Change overlay method so our color doesn't get too light/dark
- disabledSwitch.setTrackTintMode(PorterDuff.Mode.OVERLAY);
-
ColorStateList seekbarTintList = ColorStateList.valueOf(accentColor);
SeekBar seekbar = container.findViewById(R.id.preview_seekbar);
seekbar.setThumbTintList(seekbarTintList);
diff --git a/src/com/android/customization/module/CustomizationPreferences.java b/src/com/android/customization/module/CustomizationPreferences.java
index 0c09826..dc7662c 100644
--- a/src/com/android/customization/module/CustomizationPreferences.java
+++ b/src/com/android/customization/module/CustomizationPreferences.java
@@ -20,6 +20,7 @@
public interface CustomizationPreferences extends WallpaperPreferences {
String KEY_CUSTOM_THEME= "themepicker_custom_theme";
+ String KEY_VISITED_PREFIX = "themepicker_visited_";
String getSerializedCustomTheme();
diff --git a/src/com/android/customization/module/DefaultCustomizationPreferences.java b/src/com/android/customization/module/DefaultCustomizationPreferences.java
index cd3cc2d..202ff49 100644
--- a/src/com/android/customization/module/DefaultCustomizationPreferences.java
+++ b/src/com/android/customization/module/DefaultCustomizationPreferences.java
@@ -39,11 +39,11 @@
@Override
public boolean getTabVisited(String id) {
- return mSharedPrefs.getBoolean(id, false);
+ return mSharedPrefs.getBoolean(KEY_VISITED_PREFIX + id, false);
}
@Override
public void setTabVisited(String id) {
- mSharedPrefs.edit().putBoolean(id, true).apply();
+ mSharedPrefs.edit().putBoolean(KEY_VISITED_PREFIX + id, true).apply();
}
}
diff --git a/src/com/android/customization/picker/CustomizationPickerActivity.java b/src/com/android/customization/picker/CustomizationPickerActivity.java
index c5b79f1..c20b73f 100644
--- a/src/com/android/customization/picker/CustomizationPickerActivity.java
+++ b/src/com/android/customization/picker/CustomizationPickerActivity.java
@@ -55,6 +55,7 @@
import com.android.customization.picker.grid.GridFragment.GridFragmentHost;
import com.android.customization.picker.theme.ThemeFragment;
import com.android.customization.picker.theme.ThemeFragment.ThemeFragmentHost;
+import com.android.customization.widget.NoTintDrawableWrapper;
import com.android.wallpaper.R;
import com.android.wallpaper.model.WallpaperInfo;
import com.android.wallpaper.module.DailyLoggingAlarmScheduler;
@@ -96,12 +97,15 @@
private CategoryFragment mWallpaperCategoryFragment;
private WallpaperSetter mWallpaperSetter;
+ private boolean mWallpaperCategoryInitialized;
+
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Injector injector = InjectorProvider.getInjector();
mDelegate = new WallpaperPickerDelegate(this, this, injector);
mUserEventLogger = injector.getUserEventLogger(this);
initSections();
+ mWallpaperCategoryInitialized = false;
// Restore this Activity's state before restoring contained Fragments state.
super.onCreate(savedInstanceState);
@@ -202,8 +206,6 @@
private void setUpBottomNavView() {
mBottomNav = findViewById(R.id.main_bottom_nav);
- // Clear tint list so it doesn't recolor the indicator dots
- mBottomNav.setItemIconTintList(null);
Menu menu = mBottomNav.getMenu();
DefaultCustomizationPreferences prefs =
new DefaultCustomizationPreferences(getApplicationContext());
@@ -237,7 +239,7 @@
private void showTipDot(MenuItem item) {
Drawable icon = item.getIcon();
- Drawable dot = getResources().getDrawable(R.drawable.tip_dot);
+ Drawable dot = new NoTintDrawableWrapper(getResources().getDrawable(R.drawable.tip_dot));
Drawable[] layers = {icon, dot};
LayerDrawable iconWithDot = new LayerDrawable(layers);
@@ -254,6 +256,7 @@
item.setIcon(iconWithDot);
}
+
private void hideTipDot(MenuItem item) {
Drawable iconWithDot = item.getIcon();
if (iconWithDot instanceof LayerDrawable) {
@@ -416,7 +419,10 @@
@Override
void onVisible() {
- mDelegate.initialize(mForceCategoryRefresh);
+ if (!mWallpaperCategoryInitialized) {
+ mDelegate.initialize(mForceCategoryRefresh);
+ }
+ mWallpaperCategoryInitialized = true;
}
}
diff --git a/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java b/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
index cd2c067..0cc8e08 100644
--- a/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
+++ b/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
@@ -17,6 +17,8 @@
import android.app.AlertDialog;
import android.content.Context;
+import android.content.res.ColorStateList;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -109,8 +111,13 @@
setUpToolbar(view);
} else {
setUpToolbar(view, R.menu.custom_theme_editor_menu);
+ mToolbar.getMenu().getItem(0).setIconTintList(
+ getContext().getColorStateList(R.color.toolbar_icon_color));
}
- mToolbar.setNavigationIcon(getResources().getDrawable(R.drawable.ic_close_24px, null));
+ Drawable closeIcon = getResources().getDrawable(R.drawable.ic_close_24px, null).mutate();
+ closeIcon.setTintList(getResources().getColorStateList(R.color.toolbar_icon_color, null));
+ mToolbar.setNavigationIcon(closeIcon);
+
mToolbar.setNavigationContentDescription(R.string.cancel);
mToolbar.setNavigationOnClickListener(v -> mHost.cancel());
mOptionsContainer = view.findViewById(R.id.options_container);
diff --git a/src/com/android/customization/picker/theme/ThemeFragment.java b/src/com/android/customization/picker/theme/ThemeFragment.java
index 7f6754f..e3695e4 100644
--- a/src/com/android/customization/picker/theme/ThemeFragment.java
+++ b/src/com/android/customization/picker/theme/ThemeFragment.java
@@ -32,6 +32,7 @@
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.View.MeasureSpec;
import android.view.View.OnClickListener;
import android.view.View.OnLayoutChangeListener;
import android.view.ViewGroup;
@@ -326,6 +327,7 @@
header.setCompoundDrawablesWithIntrinsicBounds(0, iconSrc, 0, 0);
header.setCompoundDrawableTintList(ColorStateList.valueOf(accentColor));
card.findViewById(R.id.theme_preview_top_bar).setVisibility(View.GONE);
+ card.findViewById(R.id.edit_label).setVisibility(View.GONE);
ViewGroup body = card.findViewById(R.id.theme_preview_card_body_container);
inflater.inflate(contentLayoutRes, body, true);
@@ -389,10 +391,14 @@
}
ViewGroup body = card.findViewById(R.id.theme_preview_card_body_container);
+
inflater.inflate(contentLayoutRes, body, true);
+
bindBody(false);
+
TextView editLabel = card.findViewById(R.id.edit_label);
editLabel.setOnClickListener(mEditClickListener);
+ card.setOnClickListener(mEditClickListener);
editLabel.setVisibility(mEditClickListener != null
? View.VISIBLE : View.INVISIBLE);
ColorStateList themeAccentColor = ColorStateList.valueOf(accentColor);
@@ -445,9 +451,7 @@
R.id.preview_icon_4, R.id.preview_icon_5
};
private int[] mColorButtonIds = {
- R.id.preview_check_selected, R.id.preview_radio_selected, R.id.preview_toggle_selected,
- R.id.preview_check_unselected, R.id.preview_radio_unselected,
- R.id.preview_toggle_unselected
+ R.id.preview_check_selected, R.id.preview_radio_selected, R.id.preview_toggle_selected
};
private int[] mColorTileIds = {
R.id.preview_color_qs_0_bg, R.id.preview_color_qs_1_bg, R.id.preview_color_qs_2_bg
@@ -585,14 +589,6 @@
enabledSwitch.setThumbTintList(tintList);
enabledSwitch.setTrackTintList(tintList);
- Switch disabledSwitch = card.findViewById(R.id.preview_toggle_unselected);
- disabledSwitch.setThumbTintList(
- ColorStateList.valueOf(res.getColor(R.color.switch_thumb_tint)));
- disabledSwitch.setTrackTintList(
- ColorStateList.valueOf(res.getColor(R.color.switch_track_tint)));
- // Change overlay method so our color doesn't get too light/dark
- disabledSwitch.setTrackTintMode(PorterDuff.Mode.OVERLAY);
-
ColorStateList seekbarTintList = ColorStateList.valueOf(accentColor);
SeekBar seekbar = card.findViewById(R.id.preview_seekbar);
seekbar.setThumbTintList(seekbarTintList);
@@ -634,7 +630,7 @@
}
if (previewInfo.wallpaperAsset != null) {
addPage(new ThemePreviewPage(activity, R.string.preview_name_wallpaper,
- R.drawable.ic_wallpaper_24px, R.layout.preview_card_wallpaper_content,
+ R.drawable.ic_nav_wallpaper, R.layout.preview_card_wallpaper_content,
previewInfo.resolveAccentColor(res)) {
private final WallpaperPreviewLayoutListener mListener =
diff --git a/src/com/android/customization/widget/NoTintDrawableWrapper.java b/src/com/android/customization/widget/NoTintDrawableWrapper.java
new file mode 100644
index 0000000..dd02f9a
--- /dev/null
+++ b/src/com/android/customization/widget/NoTintDrawableWrapper.java
@@ -0,0 +1,23 @@
+package com.android.customization.widget;
+
+import android.content.res.ColorStateList;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.DrawableWrapper;
+
+import androidx.annotation.Nullable;
+
+/**
+ * {@link DrawableWrapper} that no-ops {@link #setTint(int)} and
+ * {@link #setTintList(ColorStateList)}, leaving the original {@link Drawable} tint intact.
+ */
+public class NoTintDrawableWrapper extends DrawableWrapper {
+ public NoTintDrawableWrapper(Drawable drawable) {
+ super(drawable);
+ }
+
+ @Override
+ public void setTint(int tintColor) {}
+
+ @Override
+ public void setTintList(@Nullable ColorStateList tint) {}
+}
diff --git a/src/com/android/customization/widget/OptionSelectorController.java b/src/com/android/customization/widget/OptionSelectorController.java
index 8fe7bd8..5e4a30a 100644
--- a/src/com/android/customization/widget/OptionSelectorController.java
+++ b/src/com/android/customization/widget/OptionSelectorController.java
@@ -178,6 +178,11 @@
holder.itemView.getPaddingBottom() - (checkSize/3));
checkedFrame.setLayerInsetLeft(idx, checkSize/3);
holder.itemView.setForeground(checkedFrame);
+
+ CharSequence cd = mContainer.getContext().getString(
+ R.string.option_applied_description, option.getTitle());
+ holder.labelView.setContentDescription(cd);
+
} else if (mShowCheckmark) {
holder.itemView.setForeground(null);
}
diff --git a/src/com/android/customization/widget/PreviewPager.java b/src/com/android/customization/widget/PreviewPager.java
index eea4c65..9bf7651 100644
--- a/src/com/android/customization/widget/PreviewPager.java
+++ b/src/com/android/customization/widget/PreviewPager.java
@@ -81,10 +81,13 @@
mViewPager.setPageMargin(res.getDimensionPixelOffset(R.dimen.preview_page_gap));
mViewPager.setClipToPadding(false);
if (mPageStyle == STYLE_PEEKING) {
+ int screenWidth = mViewPager.getResources().getDisplayMetrics().widthPixels;
+ int hMargin = res.getDimensionPixelOffset(R.dimen.preview_page_horizontal_margin);
+ hMargin = Math.max(hMargin, screenWidth/8);
mViewPager.setPadding(
- res.getDimensionPixelOffset(R.dimen.preview_page_horizontal_margin),
+ hMargin,
res.getDimensionPixelOffset(R.dimen.preview_page_top_margin),
- res.getDimensionPixelOffset(R.dimen.preview_page_horizontal_margin),
+ hMargin,
res.getDimensionPixelOffset(R.dimen.preview_page_bottom_margin));
} else if (mPageStyle == STYLE_ASPECT_RATIO) {
DisplayMetrics dm = res.getDisplayMetrics();