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

Commit 6e220d4c authored by George Lin's avatar George Lin
Browse files

Move enum class Screen (1/3)

The enum is shared in many places, thus moving it out of the Section
class

Test: Build success
Bug: 342637425
Flag: EXEMPTED cleanup
Change-Id: Idb270438d4f95341f3acfffce152faa05c174e04
parent 7de4d38f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.wallpaper.config.BaseFlags;
import com.android.wallpaper.model.CustomizationSectionController;
import com.android.wallpaper.model.CustomizationSectionController.CustomizationSectionNavigationController;
import com.android.wallpaper.model.PermissionRequester;
import com.android.wallpaper.model.Screen;
import com.android.wallpaper.model.WallpaperPreviewNavigator;
import com.android.wallpaper.module.CurrentWallpaperInfoFactory;
import com.android.wallpaper.module.CustomizationSections;
+2 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import com.android.customization.module.ThemePickerInjector
import com.android.customization.picker.clock.ui.binder.ClockSettingsBinder
import com.android.systemui.shared.clocks.shared.model.ClockPreviewConstants
import com.android.themepicker.R
import com.android.wallpaper.module.CustomizationSections
import com.android.wallpaper.model.Screen
import com.android.wallpaper.module.InjectorProvider
import com.android.wallpaper.picker.AppbarFragment
import com.android.wallpaper.picker.customization.ui.binder.ScreenPreviewBinder
@@ -113,7 +113,7 @@ class ClockSettingsFragment : AppbarFragment() {
                        }
                    },
                    wallpaperInteractor = injector.getWallpaperInteractor(requireContext()),
                    screen = CustomizationSections.Screen.LOCK_SCREEN,
                    screen = Screen.LOCK_SCREEN,
                ),
            lifecycleOwner = this,
            offsetToStart = displayUtils.isSingleDisplayOrUnfoldedHorizontalHinge(activity),
+8 −8
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ import com.android.customization.model.mode.DarkModeSectionController
import com.android.customization.module.ThemePickerInjector
import com.android.customization.picker.color.ui.binder.ColorPickerBinder
import com.android.themepicker.R
import com.android.wallpaper.module.CustomizationSections
import com.android.wallpaper.model.Screen
import com.android.wallpaper.module.InjectorProvider
import com.android.wallpaper.picker.AppbarFragment
import com.android.wallpaper.picker.customization.data.repository.WallpaperColorsRepository
@@ -126,7 +126,7 @@ class ColorPickerFragment : AppbarFragment() {
                                            loadInitialColors(
                                                wallpaperManager,
                                                wallpaperColorsRepository,
                                                CustomizationSections.Screen.LOCK_SCREEN
                                                Screen.LOCK_SCREEN
                                            )
                                        }
                                    }
@@ -138,7 +138,7 @@ class ColorPickerFragment : AppbarFragment() {
                            wallpaperColorsRepository.setLockWallpaperColors(colors)
                        },
                        wallpaperInteractor = injector.getWallpaperInteractor(requireContext()),
                        screen = CustomizationSections.Screen.LOCK_SCREEN,
                        screen = Screen.LOCK_SCREEN,
                    ),
                lifecycleOwner = this,
                offsetToStart =
@@ -177,7 +177,7 @@ class ColorPickerFragment : AppbarFragment() {
                                        loadInitialColors(
                                            wallpaperManager,
                                            wallpaperColorsRepository,
                                            CustomizationSections.Screen.HOME_SCREEN
                                            Screen.HOME_SCREEN
                                        )
                                    }
                                }
@@ -189,7 +189,7 @@ class ColorPickerFragment : AppbarFragment() {
                        wallpaperColorsRepository.setHomeWallpaperColors(colors)
                    },
                    wallpaperInteractor = injector.getWallpaperInteractor(requireContext()),
                    screen = CustomizationSections.Screen.HOME_SCREEN,
                    screen = Screen.HOME_SCREEN,
                ),
            lifecycleOwner = this,
            offsetToStart =
@@ -222,19 +222,19 @@ class ColorPickerFragment : AppbarFragment() {
    private suspend fun loadInitialColors(
        wallpaperManager: WallpaperManager,
        colorViewModel: WallpaperColorsRepository,
        screen: CustomizationSections.Screen,
        screen: Screen,
    ) {
        withContext(Dispatchers.IO) {
            val colors =
                wallpaperManager.getWallpaperColors(
                    if (screen == CustomizationSections.Screen.LOCK_SCREEN) {
                    if (screen == Screen.LOCK_SCREEN) {
                        WallpaperManager.FLAG_LOCK
                    } else {
                        WallpaperManager.FLAG_SYSTEM
                    }
                )
            withContext(Dispatchers.Main) {
                if (screen == CustomizationSections.Screen.LOCK_SCREEN) {
                if (screen == Screen.LOCK_SCREEN) {
                    colorViewModel.setLockWallpaperColors(colors)
                } else {
                    colorViewModel.setHomeWallpaperColors(colors)
+2 −2
Original line number Diff line number Diff line
@@ -36,8 +36,8 @@ import com.android.customization.picker.grid.ui.binder.GridScreenBinder
import com.android.customization.picker.grid.ui.viewmodel.GridScreenViewModel
import com.android.themepicker.R
import com.android.wallpaper.config.BaseFlags
import com.android.wallpaper.model.Screen
import com.android.wallpaper.module.CurrentWallpaperInfoFactory
import com.android.wallpaper.module.CustomizationSections
import com.android.wallpaper.module.InjectorProvider
import com.android.wallpaper.picker.AppbarFragment
import com.android.wallpaper.picker.customization.domain.interactor.WallpaperInteractor
@@ -192,7 +192,7 @@ class GridFragment : AppbarFragment() {
                        }
                    },
                    wallpaperInteractor = wallpaperInteractor,
                    screen = CustomizationSections.Screen.HOME_SCREEN,
                    screen = Screen.HOME_SCREEN,
                ),
            lifecycleOwner = viewLifecycleOwner,
            offsetToStart = false,
+3 −3
Original line number Diff line number Diff line
@@ -42,9 +42,9 @@ import com.android.customization.picker.color.domain.interactor.ColorPickerInter
import com.android.themepicker.R
import com.android.wallpaper.model.CustomizationSectionController
import com.android.wallpaper.model.CustomizationSectionController.CustomizationSectionNavigationController
import com.android.wallpaper.model.Screen
import com.android.wallpaper.model.WallpaperPreviewNavigator
import com.android.wallpaper.module.CurrentWallpaperInfoFactory
import com.android.wallpaper.module.CustomizationSections
import com.android.wallpaper.picker.customization.data.repository.WallpaperColorsRepository
import com.android.wallpaper.picker.customization.domain.interactor.WallpaperInteractor
import com.android.wallpaper.picker.customization.ui.section.ScreenPreviewClickView
@@ -62,7 +62,7 @@ import kotlinx.coroutines.launch
class PreviewWithClockCarouselSectionController(
    activity: ComponentActivity,
    private val lifecycleOwner: LifecycleOwner,
    private val screen: CustomizationSections.Screen,
    private val screen: Screen,
    wallpaperInfoFactory: CurrentWallpaperInfoFactory,
    wallpaperColorsRepository: WallpaperColorsRepository,
    displayUtils: DisplayUtils,
@@ -109,7 +109,7 @@ class PreviewWithClockCarouselSectionController(
        params: CustomizationSectionController.ViewCreationParams,
    ): ScreenPreviewView {
        val view = super.createView(context, params)
        if (screen == CustomizationSections.Screen.LOCK_SCREEN) {
        if (screen == Screen.LOCK_SCREEN) {
            val screenPreviewClickView: ScreenPreviewClickView =
                view.requireViewById(com.android.wallpaper.R.id.screen_preview_click_view)
            val clockColorAndSizeButtonStub: ViewStub =
Loading