Loading src/com/android/customization/module/DefaultCustomizationSections.java +14 −1 Original line number Diff line number Diff line Loading @@ -25,12 +25,16 @@ import com.android.wallpaper.model.WallpaperSectionController; import com.android.wallpaper.model.WorkspaceViewModel; 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.ScreenPreviewSectionController; import com.android.wallpaper.picker.customization.ui.section.WallpaperQuickSwitchSectionController; import com.android.wallpaper.util.DisplayUtils; import java.util.ArrayList; import java.util.List; import kotlinx.coroutines.GlobalScope; /** {@link CustomizationSections} for the customization picker. */ public final class DefaultCustomizationSections implements CustomizationSections { Loading Loading @@ -59,7 +63,8 @@ public final class DefaultCustomizationSections implements CustomizationSections CustomizationSectionNavigationController sectionNavigationController, @Nullable Bundle savedInstanceState, CurrentWallpaperInfoFactory wallpaperInfoFactory, DisplayUtils displayUtils) { DisplayUtils displayUtils, WallpaperInteractor wallpaperInteractor) { List<CustomizationSectionController<?>> sectionControllers = new ArrayList<>(); // Wallpaper section. Loading @@ -76,6 +81,14 @@ public final class DefaultCustomizationSections implements CustomizationSections sectionControllers.add(new ColorSectionController( activity, wallpaperColorsViewModel, lifecycleOwner, savedInstanceState)); // Wallpaper quick switch section. sectionControllers.add( new WallpaperQuickSwitchSectionController( wallpaperInteractor, lifecycleOwner, GlobalScope.INSTANCE, sectionNavigationController)); switch (screen) { case LOCK_SCREEN: // Lock screen quick affordances section. Loading src/com/android/customization/module/ThemePickerInjector.kt +5 −3 Original line number Diff line number Diff line Loading @@ -140,6 +140,7 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject return super<WallpaperPicker2Injector>.getSnapshotRestorers(context).toMutableMap().apply { this[KEY_QUICK_AFFORDANCE_SNAPSHOT_RESTORER] = getKeyguardQuickAffordanceSnapshotRestorer(context) this[KEY_WALLPAPER_SNAPSHOT_RESTORER] = getWallpaperSnapshotRestorer(context) } } Loading Loading @@ -197,7 +198,7 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject } } protected fun getKeyguardQuickAffordanceSnapshotRestorer( private fun getKeyguardQuickAffordanceSnapshotRestorer( context: Context ): KeyguardQuickAffordanceSnapshotRestorer { return keyguardQuickAffordanceSnapshotRestorer Loading Loading @@ -286,12 +287,13 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject @JvmStatic private val KEY_QUICK_AFFORDANCE_SNAPSHOT_RESTORER = WallpaperPicker2Injector.MIN_SNAPSHOT_RESTORER_KEY @JvmStatic private val KEY_WALLPAPER_SNAPSHOT_RESTORER = KEY_QUICK_AFFORDANCE_SNAPSHOT_RESTORER + 1 /** * When this injector is overridden, this is the minimal value that should be used by * restorers returns in [getSnapshotRestorers]. */ @JvmStatic protected val MIN_SNAPSHOT_RESTORER_KEY = KEY_QUICK_AFFORDANCE_SNAPSHOT_RESTORER + 1 @JvmStatic protected val MIN_SNAPSHOT_RESTORER_KEY = KEY_WALLPAPER_SNAPSHOT_RESTORER + 1 } } Loading
src/com/android/customization/module/DefaultCustomizationSections.java +14 −1 Original line number Diff line number Diff line Loading @@ -25,12 +25,16 @@ import com.android.wallpaper.model.WallpaperSectionController; import com.android.wallpaper.model.WorkspaceViewModel; 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.ScreenPreviewSectionController; import com.android.wallpaper.picker.customization.ui.section.WallpaperQuickSwitchSectionController; import com.android.wallpaper.util.DisplayUtils; import java.util.ArrayList; import java.util.List; import kotlinx.coroutines.GlobalScope; /** {@link CustomizationSections} for the customization picker. */ public final class DefaultCustomizationSections implements CustomizationSections { Loading Loading @@ -59,7 +63,8 @@ public final class DefaultCustomizationSections implements CustomizationSections CustomizationSectionNavigationController sectionNavigationController, @Nullable Bundle savedInstanceState, CurrentWallpaperInfoFactory wallpaperInfoFactory, DisplayUtils displayUtils) { DisplayUtils displayUtils, WallpaperInteractor wallpaperInteractor) { List<CustomizationSectionController<?>> sectionControllers = new ArrayList<>(); // Wallpaper section. Loading @@ -76,6 +81,14 @@ public final class DefaultCustomizationSections implements CustomizationSections sectionControllers.add(new ColorSectionController( activity, wallpaperColorsViewModel, lifecycleOwner, savedInstanceState)); // Wallpaper quick switch section. sectionControllers.add( new WallpaperQuickSwitchSectionController( wallpaperInteractor, lifecycleOwner, GlobalScope.INSTANCE, sectionNavigationController)); switch (screen) { case LOCK_SCREEN: // Lock screen quick affordances section. Loading
src/com/android/customization/module/ThemePickerInjector.kt +5 −3 Original line number Diff line number Diff line Loading @@ -140,6 +140,7 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject return super<WallpaperPicker2Injector>.getSnapshotRestorers(context).toMutableMap().apply { this[KEY_QUICK_AFFORDANCE_SNAPSHOT_RESTORER] = getKeyguardQuickAffordanceSnapshotRestorer(context) this[KEY_WALLPAPER_SNAPSHOT_RESTORER] = getWallpaperSnapshotRestorer(context) } } Loading Loading @@ -197,7 +198,7 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject } } protected fun getKeyguardQuickAffordanceSnapshotRestorer( private fun getKeyguardQuickAffordanceSnapshotRestorer( context: Context ): KeyguardQuickAffordanceSnapshotRestorer { return keyguardQuickAffordanceSnapshotRestorer Loading Loading @@ -286,12 +287,13 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject @JvmStatic private val KEY_QUICK_AFFORDANCE_SNAPSHOT_RESTORER = WallpaperPicker2Injector.MIN_SNAPSHOT_RESTORER_KEY @JvmStatic private val KEY_WALLPAPER_SNAPSHOT_RESTORER = KEY_QUICK_AFFORDANCE_SNAPSHOT_RESTORER + 1 /** * When this injector is overridden, this is the minimal value that should be used by * restorers returns in [getSnapshotRestorers]. */ @JvmStatic protected val MIN_SNAPSHOT_RESTORER_KEY = KEY_QUICK_AFFORDANCE_SNAPSHOT_RESTORER + 1 @JvmStatic protected val MIN_SNAPSHOT_RESTORER_KEY = KEY_WALLPAPER_SNAPSHOT_RESTORER + 1 } }