blob: a77bf2e080496a7884df4d6c48dbb2886a129477 [file] [log] [blame]
Chihhang Chuangadeb3532021-06-10 10:46:50 +08001package com.android.wallpaper.module;
2
Chihhang Chuangadeb3532021-06-10 10:46:50 +08003import android.os.Bundle;
4
5import androidx.annotation.Nullable;
Alejandro Nijamkind9b40842022-11-30 14:46:46 -08006import androidx.fragment.app.FragmentActivity;
Chihhang Chuangadeb3532021-06-10 10:46:50 +08007import androidx.lifecycle.LifecycleOwner;
8
Chihhang Chuang502bfa82021-06-15 13:57:59 +08009import com.android.wallpaper.model.CustomizationSectionController;
10import com.android.wallpaper.model.CustomizationSectionController.CustomizationSectionNavigationController;
Chihhang Chuangadeb3532021-06-10 10:46:50 +080011import com.android.wallpaper.model.PermissionRequester;
12import com.android.wallpaper.model.WallpaperColorsViewModel;
13import com.android.wallpaper.model.WallpaperPreviewNavigator;
14import com.android.wallpaper.model.WallpaperSectionController;
Catherine Liang49102b52023-02-22 20:45:41 +000015import com.android.wallpaper.picker.customization.domain.interactor.WallpaperInteractor;
Alejandro Nijamkinda89b3f2022-12-22 15:22:07 -080016import com.android.wallpaper.picker.customization.ui.section.ScreenPreviewSectionController;
Alejandro Nijamkin3deaefd2022-12-29 19:04:32 -080017import com.android.wallpaper.picker.customization.ui.section.WallpaperQuickSwitchSectionController;
Alejandro Nijamkin0b064fa2023-01-09 15:12:29 -080018import com.android.wallpaper.picker.customization.ui.viewmodel.WallpaperQuickSwitchViewModel;
Austin Wang1563f982022-12-29 16:17:03 +080019import com.android.wallpaper.util.DisplayUtils;
Chihhang Chuangadeb3532021-06-10 10:46:50 +080020
21import java.util.ArrayList;
22import java.util.List;
23
Chihhang Chuang502bfa82021-06-15 13:57:59 +080024/** {@link CustomizationSections} for the wallpaper picker. */
25public final class WallpaperPickerSections implements CustomizationSections {
Chihhang Chuangadeb3532021-06-10 10:46:50 +080026
27 @Override
Catherine Liang15a626f2023-01-09 18:58:26 +000028 public List<CustomizationSectionController<?>> getRevampedUISectionControllersForScreen(
Alejandro Nijamkinb100bf92022-12-19 10:52:46 -080029 Screen screen,
30 FragmentActivity activity,
31 LifecycleOwner lifecycleOwner,
32 WallpaperColorsViewModel wallpaperColorsViewModel,
Alejandro Nijamkinb100bf92022-12-19 10:52:46 -080033 PermissionRequester permissionRequester,
34 WallpaperPreviewNavigator wallpaperPreviewNavigator,
35 CustomizationSectionNavigationController sectionNavigationController,
Alejandro Nijamkinda89b3f2022-12-22 15:22:07 -080036 @Nullable Bundle savedInstanceState,
Austin Wang1563f982022-12-29 16:17:03 +080037 CurrentWallpaperInfoFactory wallpaperInfoFactory,
Alejandro Nijamkin3deaefd2022-12-29 19:04:32 -080038 DisplayUtils displayUtils,
Catherine Liang49102b52023-02-22 20:45:41 +000039 WallpaperQuickSwitchViewModel wallpaperQuickSwitchViewModel,
40 WallpaperInteractor wallpaperInteractor) {
Alejandro Nijamkinb100bf92022-12-19 10:52:46 -080041 List<CustomizationSectionController<?>> sectionControllers = new ArrayList<>();
42
43 sectionControllers.add(
Alejandro Nijamkinda89b3f2022-12-22 15:22:07 -080044 new ScreenPreviewSectionController(
45 activity,
46 lifecycleOwner,
47 screen,
48 wallpaperInfoFactory,
Austin Wang1563f982022-12-29 16:17:03 +080049 wallpaperColorsViewModel,
Alejandro Nijamkin3c1e4d02023-02-10 11:19:04 -080050 displayUtils,
Catherine Liang49102b52023-02-22 20:45:41 +000051 sectionNavigationController,
52 wallpaperInteractor));
Alejandro Nijamkin3deaefd2022-12-29 19:04:32 -080053 sectionControllers.add(
54 new WallpaperQuickSwitchSectionController(
Alejandro Nijamkin46c344c2023-01-10 16:25:23 -080055 screen,
Alejandro Nijamkin0b064fa2023-01-09 15:12:29 -080056 wallpaperQuickSwitchViewModel,
Alejandro Nijamkin1a530a42023-01-10 13:24:02 -080057 lifecycleOwner,
58 sectionNavigationController));
Alejandro Nijamkinb100bf92022-12-19 10:52:46 -080059
60 return sectionControllers;
61 }
62
63 @Override
Alejandro Nijamkind9b40842022-11-30 14:46:46 -080064 public List<CustomizationSectionController<?>> getAllSectionControllers(
65 FragmentActivity activity,
66 LifecycleOwner lifecycleOwner,
67 WallpaperColorsViewModel wallpaperColorsViewModel,
Alejandro Nijamkind9b40842022-11-30 14:46:46 -080068 PermissionRequester permissionRequester,
Chihhang Chuangadeb3532021-06-10 10:46:50 +080069 WallpaperPreviewNavigator wallpaperPreviewNavigator,
Chihhang Chuang502bfa82021-06-15 13:57:59 +080070 CustomizationSectionNavigationController sectionNavigationController,
Austin Wang1563f982022-12-29 16:17:03 +080071 @Nullable Bundle savedInstanceState,
72 DisplayUtils displayUtils) {
Chihhang Chuang502bfa82021-06-15 13:57:59 +080073 List<CustomizationSectionController<?>> sectionControllers = new ArrayList<>();
Chihhang Chuangadeb3532021-06-10 10:46:50 +080074
Alejandro Nijamkin58ef3692023-02-06 13:35:48 -080075 sectionControllers.add(
76 new WallpaperSectionController(
77 activity,
78 lifecycleOwner,
79 permissionRequester,
80 wallpaperColorsViewModel,
81 null,
82 sectionNavigationController,
83 wallpaperPreviewNavigator,
84 savedInstanceState,
85 displayUtils));
Chihhang Chuangadeb3532021-06-10 10:46:50 +080086
87 return sectionControllers;
88 }
89}