Loading res/layout/fragment_grid.xml +1 −2 Original line number Diff line number Diff line Loading @@ -55,13 +55,12 @@ android:layout_marginHorizontal="24dp" android:layout_marginBottom="28dp" android:background="@drawable/picker_fragment_background" android:paddingBottom="62dp" android:clipChildren="false"> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="22dp" android:layout_marginVertical="20dp" android:clipChildren="false"> <androidx.recyclerview.widget.RecyclerView Loading res/layout/grid_option.xml +3 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,8 @@ <ImageView android:id="@id/foreground" android:layout_width="58dp" android:layout_height="58dp" android:layout_width="48dp" android:layout_height="48dp" android:layout_gravity="center" /> </FrameLayout> Loading @@ -64,6 +64,7 @@ android:textColor="@color/system_on_surface" android:singleLine="true" android:ellipsize="end" android:textSize="12sp" android:text="Placeholder for stable size calculation, please do not remove." tools:ignore="HardcodedText" /> Loading res/layout/grid_option2.xml 0 → 100644 +63 −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:tools="http://schemas.android.com/tools" android:layout_width="@dimen/option_item_size" android:layout_height="wrap_content" android:orientation="vertical" android:gravity="center_horizontal" android:clipChildren="false"> <FrameLayout android:layout_width="@dimen/option_item_size" android:layout_height="@dimen/option_item_size" android:clipChildren="false"> <com.android.wallpaper.picker.option.ui.view.OptionItemBackground android:id="@id/background" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/option_item_background" android:importantForAccessibility="no" /> <ImageView android:id="@id/foreground" android:layout_width="48dp" android:layout_height="48dp" android:layout_gravity="center" /> </FrameLayout> <View android:layout_width="0dp" android:layout_height="8dp" /> <TextView android:id="@id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/system_on_surface" android:singleLine="true" android:ellipsize="end" android:textSize="12sp" android:text="Placeholder for stable size calculation, please do not remove." tools:ignore="HardcodedText" /> </LinearLayout> res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,7 @@ <dimen name="floating_sheet_tab_clock_font_toolbar_top_margin">16dp</dimen> <dimen name="floating_sheet_tab_clock_font_toolbar_bottom_margin">8dp</dimen> <dimen name="floating_sheet_list_item_horizontal_space">4dp</dimen> <dimen name="floating_sheet_grid_list_item_horizontal_space">10dp</dimen> <dimen name="floating_sheet_list_item_vertical_space">4dp</dimen> <dimen name="floating_sheet_clock_style_option_list_margin_bottom">8dp</dimen> <dimen name="floating_sheet_clock_style_option_width">80dp</dimen> Loading src/com/android/customization/picker/grid/ui/binder/GridScreenBinder.kt +6 −7 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.launch object GridScreenBinder { const val GRID_ITEM_SPACING_DP = 20 fun bind( view: View, viewModel: GridScreenViewModel, Loading @@ -47,12 +50,8 @@ object GridScreenBinder { ) { val optionView: RecyclerView = view.requireViewById(com.android.wallpaper.R.id.options) optionView.layoutManager = LinearLayoutManager( view.context, RecyclerView.HORIZONTAL, /* reverseLayout= */ false, ) optionView.addItemDecoration(ItemSpacing(ItemSpacing.ITEM_SPACING_DP)) LinearLayoutManager(view.context, RecyclerView.HORIZONTAL, /* reverseLayout= */ false) optionView.addItemDecoration(ItemSpacing(GRID_ITEM_SPACING_DP)) val adapter = OptionItemAdapter( layoutResourceId = R.layout.grid_option, Loading @@ -68,7 +67,7 @@ object GridScreenBinder { bindIcon = { foregroundView: View, gridIcon: GridIconViewModel -> val imageView = foregroundView as? ImageView imageView?.let { GridIconViewBinder.bind(imageView, gridIcon) } } }, ) optionView.adapter = adapter Loading Loading
res/layout/fragment_grid.xml +1 −2 Original line number Diff line number Diff line Loading @@ -55,13 +55,12 @@ android:layout_marginHorizontal="24dp" android:layout_marginBottom="28dp" android:background="@drawable/picker_fragment_background" android:paddingBottom="62dp" android:clipChildren="false"> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="22dp" android:layout_marginVertical="20dp" android:clipChildren="false"> <androidx.recyclerview.widget.RecyclerView Loading
res/layout/grid_option.xml +3 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,8 @@ <ImageView android:id="@id/foreground" android:layout_width="58dp" android:layout_height="58dp" android:layout_width="48dp" android:layout_height="48dp" android:layout_gravity="center" /> </FrameLayout> Loading @@ -64,6 +64,7 @@ android:textColor="@color/system_on_surface" android:singleLine="true" android:ellipsize="end" android:textSize="12sp" android:text="Placeholder for stable size calculation, please do not remove." tools:ignore="HardcodedText" /> Loading
res/layout/grid_option2.xml 0 → 100644 +63 −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:tools="http://schemas.android.com/tools" android:layout_width="@dimen/option_item_size" android:layout_height="wrap_content" android:orientation="vertical" android:gravity="center_horizontal" android:clipChildren="false"> <FrameLayout android:layout_width="@dimen/option_item_size" android:layout_height="@dimen/option_item_size" android:clipChildren="false"> <com.android.wallpaper.picker.option.ui.view.OptionItemBackground android:id="@id/background" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/option_item_background" android:importantForAccessibility="no" /> <ImageView android:id="@id/foreground" android:layout_width="48dp" android:layout_height="48dp" android:layout_gravity="center" /> </FrameLayout> <View android:layout_width="0dp" android:layout_height="8dp" /> <TextView android:id="@id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/system_on_surface" android:singleLine="true" android:ellipsize="end" android:textSize="12sp" android:text="Placeholder for stable size calculation, please do not remove." tools:ignore="HardcodedText" /> </LinearLayout>
res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,7 @@ <dimen name="floating_sheet_tab_clock_font_toolbar_top_margin">16dp</dimen> <dimen name="floating_sheet_tab_clock_font_toolbar_bottom_margin">8dp</dimen> <dimen name="floating_sheet_list_item_horizontal_space">4dp</dimen> <dimen name="floating_sheet_grid_list_item_horizontal_space">10dp</dimen> <dimen name="floating_sheet_list_item_vertical_space">4dp</dimen> <dimen name="floating_sheet_clock_style_option_list_margin_bottom">8dp</dimen> <dimen name="floating_sheet_clock_style_option_width">80dp</dimen> Loading
src/com/android/customization/picker/grid/ui/binder/GridScreenBinder.kt +6 −7 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.launch object GridScreenBinder { const val GRID_ITEM_SPACING_DP = 20 fun bind( view: View, viewModel: GridScreenViewModel, Loading @@ -47,12 +50,8 @@ object GridScreenBinder { ) { val optionView: RecyclerView = view.requireViewById(com.android.wallpaper.R.id.options) optionView.layoutManager = LinearLayoutManager( view.context, RecyclerView.HORIZONTAL, /* reverseLayout= */ false, ) optionView.addItemDecoration(ItemSpacing(ItemSpacing.ITEM_SPACING_DP)) LinearLayoutManager(view.context, RecyclerView.HORIZONTAL, /* reverseLayout= */ false) optionView.addItemDecoration(ItemSpacing(GRID_ITEM_SPACING_DP)) val adapter = OptionItemAdapter( layoutResourceId = R.layout.grid_option, Loading @@ -68,7 +67,7 @@ object GridScreenBinder { bindIcon = { foregroundView: View, gridIcon: GridIconViewModel -> val imageView = foregroundView as? ImageView imageView?.let { GridIconViewBinder.bind(imageView, gridIcon) } } }, ) optionView.adapter = adapter Loading