Loading res/layout/color_option2_desktop.xml 0 → 100644 +28 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2024 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <com.android.customization.picker.color.ui.view.ColorOptionIconView2 android:layout_width="@dimen/floating_sheet_color_option_size" android:layout_height="@dimen/floating_sheet_color_option_size"/> <com.android.customization.picker.color.ui.view.ColorOptionIconView2 android:layout_width="@dimen/floating_sheet_color_option_size" android:layout_height="@dimen/floating_sheet_color_option_size"/> </LinearLayout> No newline at end of file res/layout/floating_sheet_clock.xml +3 −3 Original line number Diff line number Diff line Loading @@ -34,9 +34,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> <include layout="@layout/floating_sheet_clock_color_content" android:id="@+id/clock_floating_sheet_color_content" <ViewStub android:id="@+id/clock_color_content_stub" android:inflatedId="@+id/clock_floating_sheet_color_content" android:layout_width="match_parent" android:layout_height="wrap_content" /> Loading res/layout/floating_sheet_clock_color_desktop_content.xml 0 → 100644 +84 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2024 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingVertical="@dimen/floating_sheet_content_vertical_padding" android:orientation="vertical" android:clipToPadding="false" android:clipChildren="false"> <TextView android:id="@+id/clock_color_title" style="@style/CustomizationOptionEntryTitleTextStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/clock_color_title" android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding" /> <TextView android:id="@+id/clock_color_description" style="@style/CustomizationOptionEntrySubtitleTextStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding" android:text="@string/clock_color_description" android:layout_marginBottom="16dp" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:clipToPadding="false" android:clipChildren="false" android:layout_marginBottom="20dp"> <!-- This is an invisible placeholder put in place so that the parent keeps its height stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the layout logic to keep the size of the preview container stable as well, which bodes well for setting up the SurfaceView for remote rendering without changing its size after the content is loaded into the RecyclerView. It's critical for any TextViews inside the included layout to have text. --> <include layout="@layout/color_option2_desktop" android:visibility="invisible" /> <androidx.recyclerview.widget.RecyclerView android:id="@+id/clock_color_list" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding" android:clipChildren="false" android:clipToPadding="false" /> </FrameLayout> <com.google.android.material.slider.Slider android:id="@+id/clock_color_slider" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding" android:minHeight="@dimen/touch_target_min_height" android:contentDescription="@string/accessibility_clock_slider_description" app:trackHeight="@dimen/slider_track_height" app:thumbHeight="@dimen/slider_thumb_height" android:theme="@style/Theme.Material3.DynamicColors.DayNight" /> </LinearLayout> src/com/android/wallpaper/customization/ui/binder/ClockFloatingSheetBinder.kt +9 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wallpaper.customization.ui.binder import android.content.Context import android.view.View import android.view.ViewGroup import android.view.ViewStub import android.view.ViewTreeObserver.OnGlobalLayoutListener import android.widget.ImageView import android.widget.TextView Loading Loading @@ -166,7 +167,14 @@ object ClockFloatingSheetBinder { lifecycleOwner = lifecycleOwner, ) val clockColorContent: View = view.requireViewById(R.id.clock_floating_sheet_color_content) val clockColorContentStub: ViewStub = view.requireViewById(R.id.clock_color_content_stub) clockColorContentStub.layoutResource = if (isDesktopUi) { R.layout.floating_sheet_clock_color_desktop_content } else { R.layout.floating_sheet_clock_color_content } val clockColorContent: View = clockColorContentStub.inflate() val clockColorAdapter = createClockColorOptionItemAdapter( Loading Loading
res/layout/color_option2_desktop.xml 0 → 100644 +28 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2024 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <com.android.customization.picker.color.ui.view.ColorOptionIconView2 android:layout_width="@dimen/floating_sheet_color_option_size" android:layout_height="@dimen/floating_sheet_color_option_size"/> <com.android.customization.picker.color.ui.view.ColorOptionIconView2 android:layout_width="@dimen/floating_sheet_color_option_size" android:layout_height="@dimen/floating_sheet_color_option_size"/> </LinearLayout> No newline at end of file
res/layout/floating_sheet_clock.xml +3 −3 Original line number Diff line number Diff line Loading @@ -34,9 +34,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> <include layout="@layout/floating_sheet_clock_color_content" android:id="@+id/clock_floating_sheet_color_content" <ViewStub android:id="@+id/clock_color_content_stub" android:inflatedId="@+id/clock_floating_sheet_color_content" android:layout_width="match_parent" android:layout_height="wrap_content" /> Loading
res/layout/floating_sheet_clock_color_desktop_content.xml 0 → 100644 +84 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright (C) 2024 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingVertical="@dimen/floating_sheet_content_vertical_padding" android:orientation="vertical" android:clipToPadding="false" android:clipChildren="false"> <TextView android:id="@+id/clock_color_title" style="@style/CustomizationOptionEntryTitleTextStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/clock_color_title" android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding" /> <TextView android:id="@+id/clock_color_description" style="@style/CustomizationOptionEntrySubtitleTextStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding" android:text="@string/clock_color_description" android:layout_marginBottom="16dp" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:clipToPadding="false" android:clipChildren="false" android:layout_marginBottom="20dp"> <!-- This is an invisible placeholder put in place so that the parent keeps its height stable as the RecyclerView updates from 0 items to N items. Keeping it stable allows the layout logic to keep the size of the preview container stable as well, which bodes well for setting up the SurfaceView for remote rendering without changing its size after the content is loaded into the RecyclerView. It's critical for any TextViews inside the included layout to have text. --> <include layout="@layout/color_option2_desktop" android:visibility="invisible" /> <androidx.recyclerview.widget.RecyclerView android:id="@+id/clock_color_list" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding" android:clipChildren="false" android:clipToPadding="false" /> </FrameLayout> <com.google.android.material.slider.Slider android:id="@+id/clock_color_slider" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding" android:minHeight="@dimen/touch_target_min_height" android:contentDescription="@string/accessibility_clock_slider_description" app:trackHeight="@dimen/slider_track_height" app:thumbHeight="@dimen/slider_thumb_height" android:theme="@style/Theme.Material3.DynamicColors.DayNight" /> </LinearLayout>
src/com/android/wallpaper/customization/ui/binder/ClockFloatingSheetBinder.kt +9 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wallpaper.customization.ui.binder import android.content.Context import android.view.View import android.view.ViewGroup import android.view.ViewStub import android.view.ViewTreeObserver.OnGlobalLayoutListener import android.widget.ImageView import android.widget.TextView Loading Loading @@ -166,7 +167,14 @@ object ClockFloatingSheetBinder { lifecycleOwner = lifecycleOwner, ) val clockColorContent: View = view.requireViewById(R.id.clock_floating_sheet_color_content) val clockColorContentStub: ViewStub = view.requireViewById(R.id.clock_color_content_stub) clockColorContentStub.layoutResource = if (isDesktopUi) { R.layout.floating_sheet_clock_color_desktop_content } else { R.layout.floating_sheet_clock_color_content } val clockColorContent: View = clockColorContentStub.inflate() val clockColorAdapter = createClockColorOptionItemAdapter( Loading