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<androidx.constraintlayout.widget.ConstraintLayout 17 xmlns:android="http://schemas.android.com/apk/res/android" 18 xmlns:tools="http://schemas.android.com/tools" 19 xmlns:app="http://schemas.android.com/apk/res-auto" 20 android:layout_width="match_parent" 21 android:layout_height="wrap_content" 22 android:paddingTop="@dimen/floating_sheet_clock_style_content_top_padding" 23 android:paddingBottom="@dimen/floating_sheet_clock_style_content_bottom_padding" 24 android:clipToPadding="false" 25 android:clipChildren="false"> 26 27 <FrameLayout 28 android:id="@+id/clock_style_list_container" 29 android:layout_width="0dp" 30 android:layout_height="wrap_content" 31 app:layout_constraintStart_toStartOf="parent" 32 app:layout_constraintEnd_toEndOf="parent" 33 app:layout_constraintTop_toTopOf="parent" 34 app:layout_constraintBottom_toTopOf="@+id/clock_style_clock_size_title" 35 android:layout_marginBottom="@dimen/floating_sheet_clock_style_option_list_margin_bottom" 36 android:clipToPadding="false" 37 android:clipChildren="false"> 38 39 <!-- 40 This is an invisible placeholder put in place so that the parent keeps its height 41 stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows 42 the layout logic to keep the size of the preview container stable as well, which 43 bodes well for setting up the SurfaceView for remote rendering without changing its 44 size after the content is loaded into the RecyclerView. 45 46 It's critical for any TextViews inside the included layout to have text. 47 --> 48 <include 49 layout="@layout/clock_style_option" 50 android:layout_width="@dimen/floating_sheet_clock_style_option_width" 51 android:layout_height="@dimen/floating_sheet_clock_style_option_height" 52 android:visibility="invisible" /> 53 54 <androidx.recyclerview.widget.RecyclerView 55 android:id="@+id/clock_style_list" 56 android:layout_width="match_parent" 57 android:layout_height="wrap_content" 58 android:clipChildren="false" 59 android:clipToPadding="false"/> 60 </FrameLayout> 61 62 <TextView 63 android:id="@+id/clock_style_clock_size_title" 64 style="@style/CustomizationOptionEntryTitleTextStyle" 65 android:layout_width="0dp" 66 android:layout_height="wrap_content" 67 android:text="@string/clock_size_large" 68 android:layout_marginTop="8dp" 69 android:layout_marginStart="@dimen/floating_sheet_content_horizontal_padding" 70 android:layout_marginEnd="@dimen/floating_sheet_clock_style_clock_size_text_margin_end" 71 app:layout_constraintStart_toStartOf="parent" 72 app:layout_constraintEnd_toStartOf="@+id/clock_style_clock_size_switch" 73 app:layout_constraintTop_toBottomOf="@+id/clock_style_list_container" 74 app:layout_constraintBottom_toTopOf="@+id/clock_style_clock_size_description" /> 75 76 <TextView 77 android:id="@+id/clock_style_clock_size_description" 78 style="@style/CustomizationOptionEntrySubtitleTextStyle" 79 android:layout_width="0dp" 80 android:layout_height="wrap_content" 81 android:layout_marginStart="@dimen/floating_sheet_content_horizontal_padding" 82 android:layout_marginEnd="@dimen/floating_sheet_clock_style_clock_size_text_margin_end" 83 android:text="@string/clock_size_dynamic_description" 84 app:layout_constraintStart_toStartOf="parent" 85 app:layout_constraintEnd_toStartOf="@+id/clock_style_clock_size_switch" 86 app:layout_constraintTop_toBottomOf="@+id/clock_style_clock_size_title" 87 app:layout_constraintBottom_toBottomOf="parent" /> 88 89 <Switch 90 android:id="@+id/clock_style_clock_size_switch" 91 android:layout_width="wrap_content" 92 android:layout_height="wrap_content" 93 android:layout_marginEnd="@dimen/floating_sheet_content_horizontal_padding" 94 app:layout_constraintTop_toTopOf="@+id/clock_style_clock_size_title" 95 app:layout_constraintBottom_toBottomOf="@+id/clock_style_clock_size_description" 96 app:layout_constraintEnd_toEndOf="parent" 97 style="@style/Switch.SettingsLib" 98 tools:ignore="UseSwitchCompatOrMaterialXml" /> 99</androidx.constraintlayout.widget.ConstraintLayout> 100