1<?xml version="1.0" encoding="utf-8"?><!-- 2 ~ Copyright (C) 2024 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<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 18 android:layout_width="match_parent" 19 android:layout_height="wrap_content" 20 android:paddingHorizontal="@dimen/floating_sheet_horizontal_padding" 21 android:orientation="vertical"> 22 23 <FrameLayout 24 android:id="@+id/shape_grid_floating_sheet_content_container" 25 android:layout_width="match_parent" 26 android:layout_height="wrap_content" 27 android:background="@drawable/floating_sheet_content_background" 28 android:paddingVertical="@dimen/floating_sheet_content_vertical_padding" 29 android:orientation="vertical" 30 android:clipToPadding="false" 31 android:clipChildren="false"> 32 33 <FrameLayout 34 android:id="@+id/app_shape_container" 35 android:layout_width="match_parent" 36 android:layout_height="wrap_content" 37 android:clipToPadding="false" 38 android:clipChildren="false"> 39 40 <!-- 41 This is just an invisible placeholder put in place so that the parent keeps its height 42 stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the 43 layout logic to keep the size of the preview container stable as well, which bodes well 44 for setting up the SurfaceView for remote rendering without changing its size after the 45 content is loaded into the RecyclerView. 46 47 It's critical for any TextViews inside the included layout to have text. 48 --> 49 <include 50 layout="@layout/shape_option" 51 android:layout_width="64dp" 52 android:layout_height="64dp" 53 android:visibility="invisible" /> 54 55 <androidx.recyclerview.widget.RecyclerView 56 android:id="@+id/shape_options" 57 android:layout_width="wrap_content" 58 android:layout_height="wrap_content" 59 android:layout_gravity="center_horizontal" 60 android:clipToPadding="false" 61 android:clipChildren="false" /> 62 </FrameLayout> 63 64 <FrameLayout 65 android:id="@+id/app_grid_container" 66 android:layout_width="match_parent" 67 android:layout_height="wrap_content" 68 android:clipToPadding="false" 69 android:clipChildren="false"> 70 71 <!-- 72 This is just an invisible placeholder put in place so that the parent keeps its height 73 stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the 74 layout logic to keep the size of the preview container stable as well, which bodes well 75 for setting up the SurfaceView for remote rendering without changing its size after the 76 content is loaded into the RecyclerView. 77 78 It's critical for any TextViews inside the included layout to have text. 79 --> 80 <include 81 layout="@layout/grid_option" 82 android:id="@+id/invisible_grid_option" 83 android:layout_width="wrap_content" 84 android:layout_height="wrap_content" 85 android:visibility="invisible"/> 86 87 <androidx.recyclerview.widget.RecyclerView 88 android:id="@+id/grid_options" 89 android:layout_width="wrap_content" 90 android:layout_height="wrap_content" 91 android:clipToPadding="false" 92 android:clipChildren="false" 93 android:layout_gravity="center_horizontal" /> 94 </FrameLayout> 95 </FrameLayout> 96 97 <com.android.wallpaper.picker.customization.ui.view.FloatingToolbar 98 android:id="@+id/floating_toolbar" 99 android:layout_width="wrap_content" 100 android:layout_height="wrap_content" 101 android:layout_gravity="center_horizontal" 102 android:layout_marginVertical="@dimen/floating_sheet_tab_toolbar_vertical_margin" /> 103</LinearLayout>