1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright (C) 2018 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16--> 17<LinearLayout 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:app="http://schemas.android.com/apk/res-auto" 20 android:layout_width="match_parent" 21 android:layout_height="match_parent" 22 android:orientation="vertical" 23 android:background="?android:colorPrimary"> 24 <include layout="@layout/section_header"/> 25 26 <FrameLayout 27 android:layout_width="match_parent" 28 android:layout_height="match_parent"> 29 30 <androidx.constraintlayout.widget.ConstraintLayout 31 android:id="@+id/content_section" 32 android:layout_width="match_parent" 33 android:layout_height="match_parent"> 34 35 <com.android.customization.widget.PreviewPager 36 android:id="@+id/theme_preview_pager" 37 android:layout_width="match_parent" 38 android:layout_height="wrap_content" 39 android:background="@color/preview_pager_background" 40 app:layout_constrainedHeight="true" 41 app:layout_constraintBottom_toTopOf="@id/options_container" 42 app:layout_constraintEnd_toEndOf="parent" 43 app:layout_constraintHeight_max="@dimen/preview_pager_max_height" 44 app:layout_constraintStart_toStartOf="parent" 45 app:layout_constraintTop_toTopOf="parent" 46 app:layout_constraintVertical_bias="0.0" 47 app:layout_constraintVertical_chainStyle="spread_inside"/> 48 49 <androidx.recyclerview.widget.RecyclerView 50 android:id="@+id/options_container" 51 android:layout_width="match_parent" 52 android:layout_height="@dimen/options_container_height" 53 android:layout_gravity="bottom|center_horizontal" 54 android:layout_marginTop="10dp" 55 android:layout_weight="1" 56 app:layout_constraintBottom_toTopOf="@id/use_my_wallpaper" 57 app:layout_constraintEnd_toEndOf="parent" 58 app:layout_constraintStart_toStartOf="parent" 59 app:layout_constraintTop_toBottomOf="@+id/theme_preview_pager" 60 app:layout_constraintVertical_bias="1.0"/> 61 62 <CheckBox 63 android:id="@+id/use_my_wallpaper" 64 android:layout_width="wrap_content" 65 android:layout_height="@dimen/min_taptarget_height" 66 android:layout_marginStart="10dp" 67 android:ellipsize="end" 68 android:gravity="start|center_vertical" 69 android:paddingLeft="4dp" 70 android:text="@string/keep_my_wallpaper" 71 app:layout_constraintBottom_toTopOf="@id/apply_button" 72 app:layout_constraintEnd_toEndOf="parent" 73 app:layout_constraintHeight_min="@dimen/min_taptarget_height" 74 app:layout_constraintHorizontal_bias="0.0" 75 app:layout_constraintStart_toStartOf="parent" 76 app:layout_constraintTop_toBottomOf="@id/options_container" 77 app:layout_constraintVertical_bias="1.0"/> 78 79 <Button 80 android:id="@+id/apply_button" 81 style="@style/ActionPrimaryButton" 82 android:layout_width="wrap_content" 83 android:layout_height="wrap_content" 84 android:layout_gravity="end" 85 android:layout_marginEnd="10dp" 86 android:layout_marginBottom="10dp" 87 android:text="@string/apply_theme_btn" 88 app:layout_constraintBottom_toBottomOf="parent" 89 app:layout_constraintEnd_toEndOf="parent"/> 90 </androidx.constraintlayout.widget.ConstraintLayout> 91 92 <androidx.core.widget.ContentLoadingProgressBar 93 android:id="@+id/loading_indicator" 94 style="@android:style/Widget.DeviceDefault.ProgressBar" 95 android:layout_width="wrap_content" 96 android:layout_height="wrap_content" 97 android:layout_marginTop="200dp" 98 android:layout_gravity="center_horizontal|top" 99 android:indeterminate="true"/> 100 101 <FrameLayout 102 android:id="@+id/error_section" 103 android:layout_width="match_parent" 104 android:layout_height="match_parent" 105 android:visibility="gone"> 106 <TextView 107 android:id="@+id/error_message" 108 style="@style/HeaderTextAppearance" 109 android:layout_width="match_parent" 110 android:layout_height="wrap_content" 111 android:layout_gravity="center" 112 android:gravity="center" 113 android:text="@string/something_went_wrong"/> 114 </FrameLayout> 115 </FrameLayout> 116</LinearLayout> 117