• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3     Copyright (C) 2019 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/grid_preview_pager"
37                android:layout_width="match_parent"
38                android:layout_height="wrap_content"
39                android:background="@color/preview_pager_background"
40                app:card_style="screen_aspect_ratio"
41                app:layout_constrainedHeight="true"
42                app:layout_constraintBottom_toTopOf="@id/options_container"
43                app:layout_constraintEnd_toEndOf="parent"
44                app:layout_constraintHeight_max="@dimen/preview_pager_max_height"
45                app:layout_constraintHeight_min="@dimen/preview_pager_min_height"
46                app:layout_constraintVertical_bias="0.0"
47                app:layout_constraintStart_toStartOf="parent"
48                app:layout_constraintTop_toTopOf="parent"
49                app:layout_constraintVertical_chainStyle="spread_inside"/>
50
51            <androidx.recyclerview.widget.RecyclerView
52                android:id="@+id/options_container"
53                android:layout_width="match_parent"
54                android:layout_height="@dimen/options_container_height"
55                android:layout_gravity="center_horizontal"
56                android:layout_marginTop="10dp"
57                app:layout_constraintBottom_toTopOf="@id/placeholder"
58                app:layout_constraintEnd_toEndOf="parent"
59                app:layout_constraintStart_toStartOf="parent"
60                app:layout_constraintTop_toBottomOf="@+id/grid_preview_pager"
61                app:layout_constraintVertical_bias="1.0"/>
62
63            <Space
64                android:id="@+id/placeholder"
65                android:layout_width="match_parent"
66                android:layout_height="@dimen/min_taptarget_height"
67                app:layout_constraintBottom_toTopOf="@id/apply_button"
68                app:layout_constraintStart_toStartOf="parent"
69                app:layout_constraintTop_toBottomOf="@id/options_container"
70                app:layout_constraintVertical_bias="1.0"/>
71
72            <Button
73                android:id="@+id/apply_button"
74                style="@style/ActionPrimaryButton"
75                android:layout_width="wrap_content"
76                android:layout_height="wrap_content"
77                android:layout_gravity="end"
78                android:layout_marginEnd="10dp"
79                android:layout_marginVertical="10dp"
80                android:layout_weight="1"
81                android:text="@string/apply_theme_btn"
82                app:layout_constraintBottom_toBottomOf="parent"
83                app:layout_constraintEnd_toEndOf="parent"/>
84
85        </androidx.constraintlayout.widget.ConstraintLayout>
86
87        <androidx.core.widget.ContentLoadingProgressBar
88            android:id="@+id/loading_indicator"
89            style="@android:style/Widget.DeviceDefault.ProgressBar"
90            android:layout_width="wrap_content"
91            android:layout_height="wrap_content"
92            android:layout_marginTop="200dp"
93            android:layout_gravity="center_horizontal|top"
94            android:indeterminate="true"/>
95        <FrameLayout
96            android:id="@+id/error_section"
97            android:layout_width="match_parent"
98            android:layout_height="match_parent"
99            android:visibility="gone">
100            <TextView
101                android:id="@+id/error_message"
102                style="@style/HeaderTextAppearance"
103                android:layout_width="match_parent"
104                android:layout_height="wrap_content"
105                android:layout_gravity="center"
106                android:gravity="center"
107                android:text="@string/something_went_wrong"/>
108        </FrameLayout>
109    </FrameLayout>
110</LinearLayout>
111