[ThemePicker 7/N] Initial setup of ThemeFragment UI
Add a view for the theme preview card for font, and hook up
the option tiles as well.
Bug: 120559294
Change-Id: I7efa779e9db730f8aaff151eac65bee42ed5db6b
diff --git a/res/layout/fragment_theme_picker.xml b/res/layout/fragment_theme_picker.xml
index 95702f1..0fd4044 100644
--- a/res/layout/fragment_theme_picker.xml
+++ b/res/layout/fragment_theme_picker.xml
@@ -22,7 +22,12 @@
android:background="@color/category_picker_background_color">
<include layout="@layout/section_header"/>
- <!-- TODO(santie): Preview pager goes here... -->
+ <com.android.customization.widget.PreviewPager
+ android:id="@+id/theme_preview_pager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:background="@color/secondary_color"/>
<LinearLayout
android:id="@+id/options_section"
diff --git a/res/layout/preview_card_font_content.xml b/res/layout/preview_card_font_content.xml
new file mode 100644
index 0000000..bc66f20
--- /dev/null
+++ b/res/layout/preview_card_font_content.xml
@@ -0,0 +1,41 @@
+<?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.
+-->
+<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="match_parent"
+ android:layout_gravity="center"
+ android:gravity="center_horizontal"
+ android:orientation="vertical"
+ tools:showIn="@layout/theme_preview_card">
+ <TextView
+ style="@style/FontCardTitleStyle"
+ 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"/>
+ <TextView
+ style="@style/FontCardBodyTextStyle"
+ android:id="@+id/font_card_body"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
+ android:text="@string/font_card_body"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/theme_option.xml b/res/layout/theme_option.xml
index fc08f6b..9e2ef82 100644
--- a/res/layout/theme_option.xml
+++ b/res/layout/theme_option.xml
@@ -63,4 +63,4 @@
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"/>
</RelativeLayout>
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/theme_preview_card.xml b/res/layout/theme_preview_card.xml
new file mode 100644
index 0000000..0f2e2ea
--- /dev/null
+++ b/res/layout/theme_preview_card.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<androidx.cardview.widget.CardView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/PreviewCard"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <TextView
+ android:id="@+id/theme_preview_card_header"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginBottom="8dp"
+ android:drawablePadding="10dp"
+ android:textAppearance="@style/CardTitleTextAppearance"/>
+ <FrameLayout
+ android:id="@+id/theme_preview_card_body_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginHorizontal="24dp">
+ </FrameLayout>
+ </LinearLayout>
+
+</androidx.cardview.widget.CardView>
\ No newline at end of file