1 /* 2 * Copyright (C) 2022 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 18 package com.android.customization.picker.quickaffordance.ui.viewmodel 19 20 import com.android.wallpaper.picker.common.icon.ui.viewmodel.Icon 21 import com.android.wallpaper.picker.option.ui.viewmodel.OptionItemViewModel 22 23 /** Models UI state for a single lock screen quick affordance slot in a picker experience. */ 24 data class KeyguardQuickAffordanceSlotViewModel( 25 /** User-visible name for the slot. */ 26 val name: String, 27 28 /** Whether this is the currently-selected slot in the picker. */ 29 val isSelected: Boolean, 30 31 /** 32 * The list of quick affordances selected for this slot. 33 * 34 * Useful for preview. 35 */ 36 val selectedQuickAffordances: List<OptionItemViewModel<Icon>>, 37 38 /** 39 * The maximum number of quick affordances that can be selected for this slot. 40 * 41 * Useful for picker and preview. 42 */ 43 val maxSelectedQuickAffordances: Int, 44 45 /** Notifies that the slot has been clicked by the user. */ 46 val onClicked: (() -> Unit)?, 47 ) 48