Cleanup for theme picker
- Remove the ThemePreviewPage and related layout/dimens.
- Remove the v2 suffix, they are the v1 now.
Test: Build and run successfully
Bug: 151285476
Change-Id: Ie79b8676c3f28cbec77c04db65c16445276a3345
diff --git a/res/layout-land/fragment_custom_theme_name.xml b/res/layout-land/fragment_custom_theme_name.xml
index bc55bb6..53cf513 100644
--- a/res/layout-land/fragment_custom_theme_name.xml
+++ b/res/layout-land/fragment_custom_theme_name.xml
@@ -35,7 +35,7 @@
android:paddingBottom="@dimen/preview_content_padding_bottom"
android:clipToPadding="false"
android:background="@color/fullscreen_preview_background">
- <include layout="@layout/theme_preview_card_v2"/>
+ <include layout="@layout/theme_preview_card"/>
</FrameLayout>
<LinearLayout
android:id="@+id/options_section"
diff --git a/res/layout-land/fragment_theme_picker.xml b/res/layout-land/fragment_theme_picker.xml
index 915fb47..fe660cf 100644
--- a/res/layout-land/fragment_theme_picker.xml
+++ b/res/layout-land/fragment_theme_picker.xml
@@ -38,12 +38,12 @@
<FrameLayout
android:id="@+id/preview_card_container"
android:layout_width="match_parent"
- android:layout_height="@dimen/preview_content_height"
+ android:layout_height="wrap_content"
android:paddingTop="@dimen/preview_content_padding_top"
android:paddingBottom="@dimen/preview_content_padding_bottom"
android:clipToPadding="false"
android:background="@color/fullscreen_preview_background">
- <include layout="@layout/theme_preview_card_v2"/>
+ <include layout="@layout/theme_preview_card"/>
</FrameLayout>
</FrameLayout>
diff --git a/res/layout/fragment_custom_theme_name.xml b/res/layout/fragment_custom_theme_name.xml
index f5dfd42..27a8f19 100644
--- a/res/layout/fragment_custom_theme_name.xml
+++ b/res/layout/fragment_custom_theme_name.xml
@@ -43,7 +43,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
- <include layout="@layout/theme_preview_card_v2"/>
+ <include layout="@layout/theme_preview_card"/>
</FrameLayout>
<androidx.constraintlayout.widget.Guideline
diff --git a/res/layout/fragment_theme_full_preview.xml b/res/layout/fragment_theme_full_preview.xml
index 7573c5b..008a795 100644
--- a/res/layout/fragment_theme_full_preview.xml
+++ b/res/layout/fragment_theme_full_preview.xml
@@ -31,6 +31,6 @@
android:clipToPadding="false"
android:background="@color/fullscreen_preview_background">
- <include layout="@layout/theme_preview_card_v2"/>
+ <include layout="@layout/theme_preview_card"/>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/fragment_theme_picker.xml b/res/layout/fragment_theme_picker.xml
index c61c389..a773207 100644
--- a/res/layout/fragment_theme_picker.xml
+++ b/res/layout/fragment_theme_picker.xml
@@ -46,7 +46,7 @@
app:layout_constraintHeight_max="@dimen/preview_pager_max_height"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintHeight_percent="@dimen/preview_pager_maximum_height_ratio">
- <include layout="@layout/theme_preview_card_v2"/>
+ <include layout="@layout/theme_preview_card"/>
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
diff --git a/res/layout/preview_card_cover_content.xml b/res/layout/preview_card_cover_content.xml
deleted file mode 100644
index 3ab13a4..0000000
--- a/res/layout/preview_card_cover_content.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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.
--->
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- 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:clipChildren="false"
- tools:showIn="@layout/theme_preview_card">
- <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: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"/>
- <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:tint="@color/tile_enabled_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_gravity="center_horizontal"
- android:layout_marginVertical="4dp"
- android:elevation="4dp"/>
- </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/theme_preview_card.xml b/res/layout/theme_preview_card.xml
index f80e846..74d1e68 100644
--- a/res/layout/theme_preview_card.xml
+++ b/res/layout/theme_preview_card.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright (C) 2019 The Android Open Source Project
+ Copyright (C) 2020 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.
@@ -16,12 +16,24 @@
-->
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- style="@style/PreviewCard"
+ style="@style/FullContentPreviewCard"
android:layout_width="match_parent"
android:layout_height="match_parent"
- app:contentPadding="0dp">
+ android:layout_gravity="center">
- <include layout="@layout/theme_component_preview"/>
+ <ImageView
+ android:id="@+id/wallpaper_preview_image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/primary_color" />
+
+ <SurfaceView
+ android:id="@+id/wallpaper_preview_surface"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ <FrameLayout
+ android:id="@+id/theme_preview_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
</androidx.cardview.widget.CardView>
\ No newline at end of file
diff --git a/res/layout/theme_preview_card_v2.xml b/res/layout/theme_preview_card_v2.xml
deleted file mode 100644
index 74d1e68..0000000
--- a/res/layout/theme_preview_card_v2.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2020 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.
--->
-<androidx.cardview.widget.CardView
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/FullContentPreviewCard"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center">
-
- <ImageView
- android:id="@+id/wallpaper_preview_image"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/primary_color" />
-
- <SurfaceView
- android:id="@+id/wallpaper_preview_surface"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
-
- <FrameLayout
- android:id="@+id/theme_preview_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-</androidx.cardview.widget.CardView>
\ No newline at end of file
diff --git a/res/layout/theme_preview_content_v2.xml b/res/layout/theme_preview_content.xml
similarity index 100%
rename from res/layout/theme_preview_content_v2.xml
rename to res/layout/theme_preview_content.xml
diff --git a/res/values-h740dp/dimens.xml b/res/values-h740dp/dimens.xml
index a752b6b..250262f 100644
--- a/res/values-h740dp/dimens.xml
+++ b/res/values-h740dp/dimens.xml
@@ -21,7 +21,6 @@
<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_content_extra_margin">8dp</dimen>
<dimen name="preview_theme_content_min_height">152dp</dimen>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index bd37bae..134bfa7 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -29,9 +29,7 @@
<dimen name="preview_theme_icon_size">26dp</dimen>
<dimen name="preview_theme_tile_size">14dp</dimen>
<dimen name="preview_theme_shape_size">30dp</dimen>
- <dimen name="preview_theme_cover_content_extra_margin">0dp</dimen>
<dimen name="preview_theme_content_bottom">8dp</dimen>
- <dimen name="preview_theme_cover_content_bottom">36dp</dimen>
<dimen name="font_preview_divider_gap">12dp</dimen>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index ec21329..44b9f30 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -68,9 +68,7 @@
<dimen name="preview_theme_shape_size">36dp</dimen>
<dimen name="preview_theme_cover_topbar_clock_size">12sp</dimen>
<dimen name="preview_theme_cover_topbar_icon_size">16dp</dimen>
- <dimen name="preview_theme_cover_content_extra_margin">16dp</dimen>
<dimen name="preview_theme_content_bottom">@dimen/min_taptarget_height</dimen>
- <dimen name="preview_theme_cover_content_bottom">@dimen/preview_theme_content_bottom</dimen>
<!-- For the new preview of theme picker. -->
<dimen name="preview_theme_content_padding_top">12dp</dimen>
@@ -92,7 +90,6 @@
<dimen name="preview_theme_color_icons_buttons_margin_bottom">28dp</dimen>
<!-- For the customization previews on the picker. -->
- <dimen name="preview_content_height">@dimen/preview_pager_height</dimen>
<dimen name="preview_content_padding_top">@dimen/preview_page_top_margin</dimen>
<dimen name="preview_content_padding_bottom">@dimen/indicator_container_height</dimen>