Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d0a6e1b authored by Catherine Liang's avatar Catherine Liang Committed by Android (Google) Code Review
Browse files

Merge "Fix themed icon preview reload (2/3)" into udc-dev

parents 9a37c73c 493e5916
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ class GridFragment2 : AppbarFragment() {
                ),
            lifecycleOwner = this,
            offsetToStart = false,
            onPreviewDirty = { activity?.recreate() },
            onWallpaperPreviewDirty = { activity?.recreate() },
        )
    }
}
+4 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import com.android.customization.picker.color.ui.viewmodel.ColorPickerViewModel;
import com.android.customization.picker.notifications.ui.section.NotificationSectionController;
import com.android.customization.picker.notifications.ui.viewmodel.NotificationSectionViewModel;
import com.android.customization.picker.preview.ui.section.PreviewWithClockCarouselSectionController;
import com.android.customization.picker.preview.ui.section.PreviewWithThemeSectionController;
import com.android.customization.picker.quickaffordance.domain.interactor.KeyguardQuickAffordancePickerInteractor;
import com.android.customization.picker.quickaffordance.ui.section.KeyguardQuickAffordanceSectionController;
import com.android.customization.picker.quickaffordance.ui.viewmodel.KeyguardQuickAffordancePickerViewModel;
@@ -39,7 +40,6 @@ import com.android.wallpaper.module.CurrentWallpaperInfoFactory;
import com.android.wallpaper.module.CustomizationSections;
import com.android.wallpaper.picker.customization.domain.interactor.WallpaperInteractor;
import com.android.wallpaper.picker.customization.ui.section.ConnectedSectionController;
import com.android.wallpaper.picker.customization.ui.section.ScreenPreviewSectionController;
import com.android.wallpaper.picker.customization.ui.section.WallpaperQuickSwitchSectionController;
import com.android.wallpaper.picker.customization.ui.viewmodel.CustomizationPickerViewModel;
import com.android.wallpaper.util.DisplayUtils;
@@ -120,9 +120,10 @@ public final class DefaultCustomizationSections implements CustomizationSections
                        wallpaperPreviewNavigator,
                        sectionNavigationController,
                        wallpaperInteractor,
                        mThemedIconInteractor,
                        wallpaperManager,
                        isTwoPaneAndSmallWidth)
                        : new ScreenPreviewSectionController(
                        : new PreviewWithThemeSectionController(
                                activity,
                                lifecycleOwner,
                                screen,
@@ -131,6 +132,7 @@ public final class DefaultCustomizationSections implements CustomizationSections
                                displayUtils,
                                wallpaperPreviewNavigator,
                                wallpaperInteractor,
                                mThemedIconInteractor,
                                wallpaperManager,
                                isTwoPaneAndSmallWidth));

+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ class ClockSettingsFragment : AppbarFragment() {
                ),
            lifecycleOwner = this,
            offsetToStart = displayUtils.isSingleDisplayOrUnfoldedHorizontalHinge(activity),
            onPreviewDirty = { activity.recreate() },
            onWallpaperPreviewDirty = { activity.recreate() },
        )

        ClockSettingsBinder.bind(
+2 −2
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ class ColorPickerFragment : AppbarFragment() {
            lifecycleOwner = this,
            offsetToStart =
                displayUtils.isSingleDisplayOrUnfoldedHorizontalHinge(requireActivity()),
            onPreviewDirty = { activity?.recreate() },
            onWallpaperPreviewDirty = { activity?.recreate() },
        )
        ScreenPreviewBinder.bind(
            activity = requireActivity(),
@@ -152,7 +152,7 @@ class ColorPickerFragment : AppbarFragment() {
            lifecycleOwner = this,
            offsetToStart =
                displayUtils.isSingleDisplayOrUnfoldedHorizontalHinge(requireActivity()),
            onPreviewDirty = { activity?.recreate() },
            onWallpaperPreviewDirty = { activity?.recreate() },
        )
        val darkModeToggleContainerView: FrameLayout =
            view.requireViewById(R.id.dark_mode_toggle_container)
+8 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.get
import androidx.lifecycle.lifecycleScope
import com.android.customization.model.themedicon.domain.interactor.ThemedIconInteractor
import com.android.customization.picker.clock.ui.binder.ClockCarouselViewBinder
import com.android.customization.picker.clock.ui.fragment.ClockSettingsFragment
import com.android.customization.picker.clock.ui.view.ClockCarouselView
@@ -51,7 +52,10 @@ import com.android.wallpaper.util.DisplayUtils
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch

/** Controls the screen preview section. */
/**
 * A ThemePicker version of the [ScreenPreviewSectionController] that adjusts the preview for the
 * clock carousel, and also updates the preview on theme changes.
 */
class PreviewWithClockCarouselSectionController(
    activity: ComponentActivity,
    private val lifecycleOwner: LifecycleOwner,
@@ -64,10 +68,11 @@ class PreviewWithClockCarouselSectionController(
    wallpaperPreviewNavigator: WallpaperPreviewNavigator,
    private val navigationController: CustomizationSectionNavigationController,
    wallpaperInteractor: WallpaperInteractor,
    themedIconInteractor: ThemedIconInteractor,
    wallpaperManager: WallpaperManager,
    private val isTwoPaneAndSmallWidth: Boolean,
) :
    ScreenPreviewSectionController(
    PreviewWithThemeSectionController(
        activity,
        lifecycleOwner,
        screen,
@@ -76,6 +81,7 @@ class PreviewWithClockCarouselSectionController(
        displayUtils,
        wallpaperPreviewNavigator,
        wallpaperInteractor,
        themedIconInteractor,
        wallpaperManager,
        isTwoPaneAndSmallWidth,
    ) {
Loading