From e9a107102cf91c58faaa1d21dd551685f8416a19 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Fri, 4 Oct 2024 19:35:26 +0530 Subject: [PATCH 1/3] Use android.widget switches instead of google material ones --- res/layout/dark_mode_section_view.xml | 3 +-- res/layout/notification_section.xml | 3 +-- res/layout/themed_icon_section_view.xml | 3 +-- .../customization/model/mode/DarkModeSectionController.java | 4 ++-- .../customization/picker/mode/DarkModeSectionView.java | 4 ++-- .../notifications/ui/binder/NotificationSectionBinder.kt | 4 ++-- .../picker/themedicon/ThemedIconSectionView.java | 6 +++--- 7 files changed, 12 insertions(+), 15 deletions(-) diff --git a/res/layout/dark_mode_section_view.xml b/res/layout/dark_mode_section_view.xml index 7eae574aa..be7385dd2 100644 --- a/res/layout/dark_mode_section_view.xml +++ b/res/layout/dark_mode_section_view.xml @@ -33,14 +33,13 @@ android:text="@string/mode_title" style="@style/SectionTitleTextStyle" /> - - diff --git a/res/layout/themed_icon_section_view.xml b/res/layout/themed_icon_section_view.xml index 6731cbe26..9799df32c 100644 --- a/res/layout/themed_icon_section_view.xml +++ b/res/layout/themed_icon_section_view.xml @@ -39,14 +39,13 @@ android:text="@string/themed_icon_title" style="@style/SectionTitleTextStyle" /> - switchView.setChecked(mIsDarkModeActivated) diff --git a/src/com/android/customization/picker/notifications/ui/binder/NotificationSectionBinder.kt b/src/com/android/customization/picker/notifications/ui/binder/NotificationSectionBinder.kt index e4b2ce576..36db68c63 100644 --- a/src/com/android/customization/picker/notifications/ui/binder/NotificationSectionBinder.kt +++ b/src/com/android/customization/picker/notifications/ui/binder/NotificationSectionBinder.kt @@ -19,13 +19,13 @@ package com.android.customization.picker.notifications.ui.binder import android.annotation.SuppressLint import android.view.View +import android.widget.Switch; import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.android.customization.picker.notifications.ui.viewmodel.NotificationSectionViewModel import com.android.themepicker.R -import com.google.android.material.materialswitch.MaterialSwitch import kotlinx.coroutines.launch /** @@ -38,7 +38,7 @@ object NotificationSectionBinder { viewModel: NotificationSectionViewModel, lifecycleOwner: LifecycleOwner, ) { - val switch: MaterialSwitch = view.requireViewById(R.id.switcher) + val switch: Switch = view.requireViewById(R.id.switcher) view.setOnClickListener { viewModel.onClicked() } diff --git a/src/com/android/customization/picker/themedicon/ThemedIconSectionView.java b/src/com/android/customization/picker/themedicon/ThemedIconSectionView.java index 5b379a9cf..2bbe74ee0 100644 --- a/src/com/android/customization/picker/themedicon/ThemedIconSectionView.java +++ b/src/com/android/customization/picker/themedicon/ThemedIconSectionView.java @@ -17,19 +17,19 @@ package com.android.customization.picker.themedicon; import android.content.Context; import android.util.AttributeSet; +import android.widget.Switch; import androidx.annotation.Nullable; import com.android.themepicker.R; import com.android.wallpaper.picker.SectionView; -import com.google.android.material.materialswitch.MaterialSwitch; /** * The {@link SectionView} for themed icon section view */ public class ThemedIconSectionView extends SectionView { - private MaterialSwitch mSwitchView; + private Switch mSwitchView; public ThemedIconSectionView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); @@ -49,7 +49,7 @@ public class ThemedIconSectionView extends SectionView { } /** Gets the switch view. */ - public MaterialSwitch getSwitch() { + public Switch getSwitch() { return mSwitchView; } } -- GitLab From c0cffac5b7adaa798150e7067b4be50f138887e0 Mon Sep 17 00:00:00 2001 From: althafvly Date: Wed, 16 Oct 2024 19:11:04 +0530 Subject: [PATCH 2/3] ThemePicker: Remove wallpaper color selection --- .../module/DefaultCustomizationSections.java | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/com/android/customization/module/DefaultCustomizationSections.java b/src/com/android/customization/module/DefaultCustomizationSections.java index 840c472e7..74704364d 100644 --- a/src/com/android/customization/module/DefaultCustomizationSections.java +++ b/src/com/android/customization/module/DefaultCustomizationSections.java @@ -145,23 +145,13 @@ public final class DefaultCustomizationSections implements CustomizationSections customizationPickerViewModel)); sectionControllers.add( - new ConnectedSectionController( - // Theme color section. - new ColorSectionController( - sectionNavigationController, - new ViewModelProvider( - activity, - mColorPickerViewModelFactory) - .get(ColorPickerViewModel.class), - lifecycleOwner), - // Wallpaper quick switch section. - new WallpaperQuickSwitchSectionController( - customizationPickerViewModel.getWallpaperQuickSwitchViewModel( - screen), - lifecycleOwner, - sectionNavigationController, - savedInstanceState == null), - /* reverseOrderWhenHorizontal= */ true)); + // Wallpaper quick switch section. + new WallpaperQuickSwitchSectionController( + customizationPickerViewModel.getWallpaperQuickSwitchViewModel( + screen), + lifecycleOwner, + sectionNavigationController, + savedInstanceState == null)); switch (screen) { case LOCK_SCREEN: -- GitLab From 10a12d9d8f58c886341aa18feee036bf9bcb4b24 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Thu, 17 Oct 2024 15:22:42 +0530 Subject: [PATCH 3/3] Theme components to match our palette --- res/drawable/clock_color_size_button_background_base.xml | 2 +- res/drawable/option_border.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/res/drawable/clock_color_size_button_background_base.xml b/res/drawable/clock_color_size_button_background_base.xml index 2e6f2be5e..e29b9f2a0 100644 --- a/res/drawable/clock_color_size_button_background_base.xml +++ b/res/drawable/clock_color_size_button_background_base.xml @@ -17,5 +17,5 @@ - + \ No newline at end of file diff --git a/res/drawable/option_border.xml b/res/drawable/option_border.xml index d0fde5cab..fce166633 100644 --- a/res/drawable/option_border.xml +++ b/res/drawable/option_border.xml @@ -23,7 +23,7 @@ - + -- GitLab