1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.providers.media.photopicker.ui; 18 19 import android.annotation.IntDef; 20 21 import java.lang.annotation.Retention; 22 import java.lang.annotation.RetentionPolicy; 23 24 /** 25 * Represents the actions that can be performed on lis of items / category items, based on different 26 * scenarios like next page load, refreshing the list, updating the list on profile switch etc. 27 */ 28 public class ItemsAction { 29 30 // This is basically a no-op action which will meet no conditions in the code. 31 public static final int ACTION_DEFAULT = 0; 32 public static final int ACTION_VIEW_CREATED = 1; 33 public static final int ACTION_LOAD_NEXT_PAGE = 2; 34 public static final int ACTION_CLEAR_AND_UPDATE_LIST = 3; 35 public static final int ACTION_CLEAR_GRID = 4; 36 public static final int ACTION_REFRESH_ITEMS = 5; 37 38 ItemsAction()39 private ItemsAction() { 40 } 41 42 /** @hide */ 43 @IntDef({ACTION_DEFAULT, 44 ACTION_VIEW_CREATED, 45 ACTION_LOAD_NEXT_PAGE, 46 ACTION_CLEAR_AND_UPDATE_LIST, 47 ACTION_CLEAR_GRID, 48 ACTION_REFRESH_ITEMS}) 49 @Retention(RetentionPolicy.SOURCE) 50 public @interface Type { 51 } 52 } 53