• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.android.wallpaper.module;
2 
3 import android.app.WallpaperManager;
4 import android.os.Bundle;
5 
6 import androidx.annotation.Nullable;
7 import androidx.fragment.app.FragmentActivity;
8 import androidx.lifecycle.LifecycleOwner;
9 
10 import com.android.wallpaper.model.CustomizationSectionController;
11 import com.android.wallpaper.model.CustomizationSectionController.CustomizationSectionNavigationController;
12 import com.android.wallpaper.model.PermissionRequester;
13 import com.android.wallpaper.model.WallpaperColorsViewModel;
14 import com.android.wallpaper.model.WallpaperPreviewNavigator;
15 import com.android.wallpaper.picker.customization.domain.interactor.WallpaperInteractor;
16 import com.android.wallpaper.picker.customization.ui.viewmodel.CustomizationPickerViewModel;
17 import com.android.wallpaper.util.DisplayUtils;
18 
19 import java.util.List;
20 
21 /** Interface for carry {@link CustomizationSectionController}s. */
22 public interface CustomizationSections {
23 
24     /** Enumerates all screens supported by {@code getSectionControllersForScreen}. */
25     enum Screen {
26         LOCK_SCREEN,
27         HOME_SCREEN;
28 
toFlag()29         public int toFlag() {
30             switch (this) {
31                 case HOME_SCREEN: return WallpaperManager.FLAG_SYSTEM;
32                 case LOCK_SCREEN: return WallpaperManager.FLAG_LOCK;
33                 default: return WallpaperManager.FLAG_SYSTEM | WallpaperManager.FLAG_LOCK;
34             }
35         }
36     }
37 
38     /**
39      * Currently protected under BaseFlags.isUseRevampedUi() flag.
40      *
41      * Gets a new instance of the section controller list for the given {@link Screen}.
42      *
43      * Note that the section views will be displayed by the list ordering.
44      *
45      * <p>Don't keep the section controllers as singleton since they contain views.
46      */
getSectionControllersForScreen( Screen screen, FragmentActivity activity, LifecycleOwner lifecycleOwner, WallpaperColorsViewModel wallpaperColorsViewModel, PermissionRequester permissionRequester, WallpaperPreviewNavigator wallpaperPreviewNavigator, CustomizationSectionNavigationController sectionNavigationController, @Nullable Bundle savedInstanceState, CurrentWallpaperInfoFactory wallpaperInfoFactory, DisplayUtils displayUtils, CustomizationPickerViewModel customizationPickerViewModel, WallpaperInteractor wallpaperInteractor, WallpaperManager wallpaperManager, boolean isTwoPaneAndSmallWidth)47     List<CustomizationSectionController<?>> getSectionControllersForScreen(
48             Screen screen,
49             FragmentActivity activity,
50             LifecycleOwner lifecycleOwner,
51             WallpaperColorsViewModel wallpaperColorsViewModel,
52             PermissionRequester permissionRequester,
53             WallpaperPreviewNavigator wallpaperPreviewNavigator,
54             CustomizationSectionNavigationController sectionNavigationController,
55             @Nullable Bundle savedInstanceState,
56             CurrentWallpaperInfoFactory wallpaperInfoFactory,
57             DisplayUtils displayUtils,
58             CustomizationPickerViewModel customizationPickerViewModel,
59             WallpaperInteractor wallpaperInteractor,
60             WallpaperManager wallpaperManager,
61             boolean isTwoPaneAndSmallWidth);
62 }
63