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 package com.android.systemui.statusbar.pipeline.shared.ui.binder
18 
19 import com.android.systemui.statusbar.StatusBarIconView
20 
21 /**
22  * Defines interface for an object that acts as the binding between a modern status bar view and its
23  * view-model.
24  *
25  * Users of the view binder classes in the modern status bar pipeline should use this to control the
26  * binder after it is bound.
27  */
28 interface ModernStatusBarViewBinding {
29     /** Returns true if the icon should be visible and false otherwise. */
getShouldIconBeVisiblenull30     fun getShouldIconBeVisible(): Boolean
31 
32     /** Notifies that the visibility state has changed. */
33     fun onVisibilityStateChanged(@StatusBarIconView.VisibleState state: Int)
34 
35     /** Notifies that the icon tint has been updated. Includes a contrast for layered drawables */
36     fun onIconTintChanged(newTint: Int, contrastTint: Int)
37 
38     /** Notifies that the decor tint has been updated (used only for the dot). */
39     fun onDecorTintChanged(newTint: Int)
40 
41     /** Returns true if the binding between the view and view-model is currently collecting. */
42     fun isCollecting(): Boolean
43 }
44