1<?xml version="1.0" encoding="utf-8"?><!--
2  ~ Copyright (C) 2023 The Android Open Source Project
3  ~
4  ~ Licensed under the Apache License, Version 2.0 (the "License");
5  ~ you may not use this file except in compliance with the License.
6  ~ You may obtain a copy of the License at
7  ~
8  ~      http://www.apache.org/licenses/LICENSE-2.0
9  ~
10  ~ Unless required by applicable law or agreed to in writing, software
11  ~ distributed under the License is distributed on an "AS IS" BASIS,
12  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  ~ See the License for the specific language governing permissions and
14  ~ limitations under the License.
15  ~
16  -->
17
18<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
19    android:layout_width="match_parent"
20    android:layout_height="match_parent"
21    android:orientation="vertical"
22    android:clipChildren="false">
23
24    <FrameLayout
25        android:id="@+id/section_header_container"
26        android:layout_width="match_parent"
27        android:layout_height="wrap_content">
28
29        <include layout="@layout/section_header" />
30
31    </FrameLayout>
32
33    <com.android.wallpaper.picker.DisplayAspectRatioFrameLayout
34        android:layout_width="match_parent"
35        android:layout_height="0dp"
36        android:layout_marginHorizontal="24dp"
37        android:layout_weight="1"
38        android:paddingBottom="40dp"
39        android:paddingTop="20dp"
40        android:clipChildren="false">
41
42        <include
43            android:id="@+id/preview"
44            layout="@layout/wallpaper_preview_card"
45            android:layout_width="0dp"
46            android:layout_height="match_parent"
47            android:layout_gravity="center"/>
48
49    </com.android.wallpaper.picker.DisplayAspectRatioFrameLayout>
50
51    <LinearLayout
52        android:layout_width="match_parent"
53        android:layout_height="wrap_content"
54        android:orientation="vertical"
55        android:layout_marginHorizontal="24dp"
56        android:layout_marginBottom="28dp"
57        android:background="@drawable/picker_fragment_background"
58        android:paddingBottom="62dp"
59        android:clipChildren="false">
60
61        <FrameLayout
62            android:layout_width="match_parent"
63            android:layout_height="wrap_content"
64            android:layout_marginTop="22dp"
65            android:clipChildren="false">
66
67            <androidx.recyclerview.widget.RecyclerView
68                android:id="@id/options"
69                android:layout_width="wrap_content"
70                android:layout_height="wrap_content"
71                android:layout_gravity="center_horizontal"
72                android:clipToPadding="false"
73                android:paddingHorizontal="16dp"
74                android:clipChildren="false" />
75
76            <!--
77            This is just an invisible placeholder put in place so that the parent keeps its height
78            stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the
79            layout logic to keep the size of the preview container stable as well, which bodes well
80            for setting up the SurfaceView for remote rendering without changing its size after the
81            content is loaded into the RecyclerView.
82
83            It's critical for any TextViews inside the included layout to have text.
84            -->
85            <include
86                layout="@layout/grid_option"
87                android:layout_width="wrap_content"
88                android:layout_height="wrap_content"
89                android:visibility="invisible" />
90
91        </FrameLayout>
92
93        <Button
94            android:id="@+id/apply_button"
95            android:layout_width="wrap_content"
96            android:layout_height="wrap_content"
97            android:layout_gravity="center_horizontal"
98            android:visibility="gone"
99            android:enabled="false"
100            style="@style/ActionPrimaryButton"
101            android:text="@string/apply_btn" />
102
103        <TextView
104            android:id="@+id/apply_button_note"
105            android:layout_width="wrap_content"
106            android:layout_height="wrap_content"
107            android:layout_gravity="center_horizontal"
108            android:textSize="@dimen/grid_apply_button_note_text_size"
109            android:visibility="gone"
110            android:text="@string/apply_grid_btn_note" />
111    </LinearLayout>
112
113</LinearLayout>
114