Loading res/drawable/ic_contrast.xml 0 → 100644 +11 −0 Original line number Diff line number Diff line <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:autoMirrored="true" android:tint="@color/text_color_primary_inverse" android:viewportHeight="24" android:viewportWidth="24"> <path android:fillColor="@android:color/white" android:pathData="M12,22Q9.925,22 8.1,21.212Q6.275,20.425 4.925,19.075Q3.575,17.725 2.788,15.9Q2,14.075 2,12Q2,9.925 2.788,8.1Q3.575,6.275 4.925,4.925Q6.275,3.575 8.1,2.787Q9.925,2 12,2Q14.075,2 15.9,2.787Q17.725,3.575 19.075,4.925Q20.425,6.275 21.212,8.1Q22,9.925 22,12Q22,14.075 21.212,15.9Q20.425,17.725 19.075,19.075Q17.725,20.425 15.9,21.212Q14.075,22 12,22ZM13,19.925Q15.975,19.55 17.988,17.312Q20,15.075 20,12Q20,8.925 17.988,6.687Q15.975,4.45 13,4.075Z" /> </vector> No newline at end of file res/drawable/saturation_progress_drawable.xml 0 → 100644 +37 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 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. --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:paddingMode="stack" > <item android:id="@android:id/background" android:gravity="center_vertical|fill_horizontal"> <inset android:insetLeft="22dp" android:insetRight="22dp" > <shape> <size android:height="4dp" /> <corners android:radius="2dp" /> <solid android:color="@color/color_surface_variant" /> </shape> </inset> </item> <item android:id="@android:id/progress" android:gravity="center_vertical|fill_horizontal"> <com.android.customization.picker.clock.ui.view.SaturationProgressDrawable android:drawable="@drawable/saturation_progress_full_drawable" /> </item> </layer-list> No newline at end of file res/drawable/saturation_progress_full_drawable.xml 0 → 100644 +35 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 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. --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true"> <item android:id="@+id/slider_foreground" android:height="48dp"> <shape> <size android:height="48dp" /> <solid android:color="@color/color_accent_primary" /> <corners android:radius="24dp"/> </shape> </item> <item android:id="@+id/slider_icon" android:gravity="center_vertical|right" android:height="20dp" android:width="20dp" android:right="14dp" android:drawable="@drawable/ic_contrast" /> </layer-list> No newline at end of file res/layout/fragment_clock_settings.xml +39 −20 Original line number Diff line number Diff line Loading @@ -98,10 +98,16 @@ android:layout_height="wrap_content" android:paddingTop="16dp"> <LinearLayout android:id="@+id/color_picker_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <FrameLayout android:id="@+id/color_options_container" android:layout_width="match_parent" android:layout_height="wrap_content"> android:layout_height="wrap_content" android:layout_marginBottom="16dp"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/color_options" Loading @@ -112,10 +118,10 @@ <!-- This is just 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. 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. --> <include layout="@layout/color_option_with_background" Loading @@ -124,6 +130,19 @@ android:visibility="invisible" /> </FrameLayout> <SeekBar android:id="@+id/slider" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:minHeight="48dp" android:thumb="@null" android:background="@null" android:paddingHorizontal="16dp" android:progressDrawable="@drawable/saturation_progress_drawable" android:splitTrack="false" /> </LinearLayout> <com.android.customization.picker.clock.ui.view.ClockSizeRadioButtonGroup android:id="@+id/clock_size_radio_button_group" android:layout_width="match_parent" Loading res/values/attrs.xml +5 −0 Original line number Diff line number Diff line Loading @@ -18,4 +18,9 @@ <resources> <item name="linear_layout_horizontal_display_options_max" format="float" type="dimen">4.35 </item> <declare-styleable name="SaturationAlphaTintDrawableWrapper"> <attr name="android:tint" /> <attr name="android:alpha" /> </declare-styleable> </resources> No newline at end of file Loading
res/drawable/ic_contrast.xml 0 → 100644 +11 −0 Original line number Diff line number Diff line <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:autoMirrored="true" android:tint="@color/text_color_primary_inverse" android:viewportHeight="24" android:viewportWidth="24"> <path android:fillColor="@android:color/white" android:pathData="M12,22Q9.925,22 8.1,21.212Q6.275,20.425 4.925,19.075Q3.575,17.725 2.788,15.9Q2,14.075 2,12Q2,9.925 2.788,8.1Q3.575,6.275 4.925,4.925Q6.275,3.575 8.1,2.787Q9.925,2 12,2Q14.075,2 15.9,2.787Q17.725,3.575 19.075,4.925Q20.425,6.275 21.212,8.1Q22,9.925 22,12Q22,14.075 21.212,15.9Q20.425,17.725 19.075,19.075Q17.725,20.425 15.9,21.212Q14.075,22 12,22ZM13,19.925Q15.975,19.55 17.988,17.312Q20,15.075 20,12Q20,8.925 17.988,6.687Q15.975,4.45 13,4.075Z" /> </vector> No newline at end of file
res/drawable/saturation_progress_drawable.xml 0 → 100644 +37 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 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. --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:paddingMode="stack" > <item android:id="@android:id/background" android:gravity="center_vertical|fill_horizontal"> <inset android:insetLeft="22dp" android:insetRight="22dp" > <shape> <size android:height="4dp" /> <corners android:radius="2dp" /> <solid android:color="@color/color_surface_variant" /> </shape> </inset> </item> <item android:id="@android:id/progress" android:gravity="center_vertical|fill_horizontal"> <com.android.customization.picker.clock.ui.view.SaturationProgressDrawable android:drawable="@drawable/saturation_progress_full_drawable" /> </item> </layer-list> No newline at end of file
res/drawable/saturation_progress_full_drawable.xml 0 → 100644 +35 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 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. --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true"> <item android:id="@+id/slider_foreground" android:height="48dp"> <shape> <size android:height="48dp" /> <solid android:color="@color/color_accent_primary" /> <corners android:radius="24dp"/> </shape> </item> <item android:id="@+id/slider_icon" android:gravity="center_vertical|right" android:height="20dp" android:width="20dp" android:right="14dp" android:drawable="@drawable/ic_contrast" /> </layer-list> No newline at end of file
res/layout/fragment_clock_settings.xml +39 −20 Original line number Diff line number Diff line Loading @@ -98,10 +98,16 @@ android:layout_height="wrap_content" android:paddingTop="16dp"> <LinearLayout android:id="@+id/color_picker_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <FrameLayout android:id="@+id/color_options_container" android:layout_width="match_parent" android:layout_height="wrap_content"> android:layout_height="wrap_content" android:layout_marginBottom="16dp"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/color_options" Loading @@ -112,10 +118,10 @@ <!-- This is just 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. 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. --> <include layout="@layout/color_option_with_background" Loading @@ -124,6 +130,19 @@ android:visibility="invisible" /> </FrameLayout> <SeekBar android:id="@+id/slider" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:minHeight="48dp" android:thumb="@null" android:background="@null" android:paddingHorizontal="16dp" android:progressDrawable="@drawable/saturation_progress_drawable" android:splitTrack="false" /> </LinearLayout> <com.android.customization.picker.clock.ui.view.ClockSizeRadioButtonGroup android:id="@+id/clock_size_radio_button_group" android:layout_width="match_parent" Loading
res/values/attrs.xml +5 −0 Original line number Diff line number Diff line Loading @@ -18,4 +18,9 @@ <resources> <item name="linear_layout_horizontal_display_options_max" format="float" type="dimen">4.35 </item> <declare-styleable name="SaturationAlphaTintDrawableWrapper"> <attr name="android:tint" /> <attr name="android:alpha" /> </declare-styleable> </resources> No newline at end of file