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 59 <FrameLayout 60 android:layout_width="match_parent" 61 android:layout_height="wrap_content" 62 android:paddingVertical="20dp" 63 android:clipChildren="false" 64 android:clipToPadding="false"> 65 66 <androidx.recyclerview.widget.RecyclerView 67 android:id="@id/options" 68 android:layout_width="wrap_content" 69 android:layout_height="wrap_content" 70 android:layout_gravity="center_horizontal" 71 android:paddingHorizontal="16dp" 72 android:clipChildren="false" 73 android:clipToPadding="false"/> 74 75 <!-- 76 This is just an invisible placeholder put in place so that the parent keeps its height 77 stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the 78 layout logic to keep the size of the preview container stable as well, which bodes well 79 for setting up the SurfaceView for remote rendering without changing its size after the 80 content is loaded into the RecyclerView. 81 82 It's critical for any TextViews inside the included layout to have text. 83 --> 84 <include 85 layout="@layout/grid_option" 86 android:layout_width="wrap_content" 87 android:layout_height="wrap_content" 88 android:visibility="invisible" /> 89 90 </FrameLayout> 91 92 <Button 93 android:id="@+id/apply_button" 94 android:layout_width="wrap_content" 95 android:layout_height="wrap_content" 96 android:layout_gravity="center_horizontal" 97 android:visibility="gone" 98 android:enabled="false" 99 style="@style/ActionPrimaryButton" 100 android:text="@string/apply_btn" /> 101 102 <TextView 103 android:id="@+id/apply_button_note" 104 android:layout_width="wrap_content" 105 android:layout_height="wrap_content" 106 android:layout_gravity="center_horizontal" 107 android:textSize="@dimen/grid_apply_button_note_text_size" 108 android:visibility="gone" 109 android:text="@string/apply_grid_btn_note" /> 110 </LinearLayout> 111 112</LinearLayout> 113