1 /*
2  * Copyright (C) 2024 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.quickstep.task.viewmodel
18 
19 import android.graphics.Matrix
20 import com.android.quickstep.task.thumbnail.TaskThumbnailUiState
21 import kotlinx.coroutines.flow.Flow
22 
23 /** ViewModel for representing TaskThumbnails */
24 interface TaskThumbnailViewModel {
25     /** Provides the level of dimming that the View should have */
26     val dimProgress: Flow<Float>
27 
28     /** Provides the alpha of the splash icon */
29     val splashAlpha: Flow<Float>
30 
31     /** Provides the UiState by which the task thumbnail can be represented */
32     val uiState: Flow<TaskThumbnailUiState>
33 
34     /** Attaches this ViewModel to a specific task id for it to provide data from. */
bindnull35     fun bind(taskId: Int)
36 
37     /** Returns a Matrix which can be applied to the snapshot */
38     fun getThumbnailPositionState(width: Int, height: Int, isRtl: Boolean): Matrix
39 }
40