Add new preview for theme picker (Part1)
- Uses a flag to hide the new preview until it's ready.
- Uses the apply button of bottom action bar.
Screenshot:
flag is false: https://screenshot.googleplex.com/nDyDnt708tL.png
flag is ture: https://screenshot.googleplex.com/R76eoVL0rNy.png
Test: Manually
Bug: 146475648
Change-Id: I49e33e011da106e7773a66a1238cc462a873c1cc
diff --git a/res/layout/fragment_theme_picker.xml b/res/layout/fragment_theme_picker.xml
index d15d93f..93606ea 100644
--- a/res/layout/fragment_theme_picker.xml
+++ b/res/layout/fragment_theme_picker.xml
@@ -16,7 +16,6 @@
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
@@ -27,49 +26,40 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
- <androidx.constraintlayout.widget.ConstraintLayout
+ <LinearLayout
android:id="@+id/content_section"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <!-- The V2 preview card. -->
+ <FrameLayout
+ android:id="@+id/preview_card_container"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/preview_content_height"
+ android:paddingTop="@dimen/preview_content_padding_top"
+ android:paddingBottom="@dimen/preview_content_padding_bottom"
+ android:clipToPadding="false"
+ android:background="@color/fullscreen_preview_background"
+ android:visibility="gone">
+ <include layout="@layout/theme_preview_card_v2"/>
+ </FrameLayout>
+
+ <!-- Will remove it later. -->
<com.android.wallpaper.widget.PreviewPager
android:id="@+id/theme_preview_pager"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/preview_pager_background"
- app:layout_constrainedHeight="true"
- app:layout_constraintBottom_toTopOf="@id/options_container"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHeight_max="@dimen/preview_pager_max_height"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintVertical_bias="0.0"
- app:layout_constraintVertical_chainStyle="spread_inside"/>
+ android:layout_height="@dimen/preview_content_height"
+ android:background="@color/preview_pager_background"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/options_container"
android:layout_width="match_parent"
- android:layout_height="@dimen/options_container_height"
+ android:layout_height="0dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginTop="10dp"
- android:layout_weight="1"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/theme_preview_pager"
- app:layout_constraintVertical_bias="1.0"/>
-
- <Button
- android:id="@+id/apply_button"
- style="@style/ActionPrimaryButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="end"
- android:layout_marginEnd="10dp"
- android:layout_marginBottom="10dp"
- android:text="@string/apply_theme_btn"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"/>
- </androidx.constraintlayout.widget.ConstraintLayout>
+ android:layout_weight="1"/>
+ </LinearLayout>
<androidx.core.widget.ContentLoadingProgressBar
android:id="@+id/loading_indicator"