1 /*
2  * Copyright (C) 2017 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;
18 
19 import com.android.systemui.plugins.DarkIconDispatcher.DarkReceiver;
20 
21 public interface StatusIconDisplayable extends DarkReceiver {
getSlot()22     String getSlot();
setStaticDrawableColor(int color)23     void setStaticDrawableColor(int color);
24 
25     /**
26      * For a layer drawable, or one that has a background, {@code tintColor} should be used as the
27      * background tint for the container, while {@code contrastColor} can be used as the foreground
28      * drawable's tint so that it is visible on the background. Essentially, tintColor should apply
29      * to the portion of the icon that borders the underlying window content (status bar's
30      * background), and the contrastColor only need be used to distinguish from the tintColor.
31      *
32      * Defaults to calling {@link #setStaticDrawableColor(int)} with only the tint color, so modern
33      * callers can just call this method and still get the default behavior.
34      */
setStaticDrawableColor(int tintColor, int contrastColor)35     default void setStaticDrawableColor(int tintColor, int contrastColor) {
36         setStaticDrawableColor(tintColor);
37     }
38 
setDecorColor(int color)39     void setDecorColor(int color);
40 
41     /** Sets the visible state that this displayable should be. */
setVisibleState(@tatusBarIconView.VisibleState int state)42     default void setVisibleState(@StatusBarIconView.VisibleState int state) {
43         setVisibleState(state, false);
44     }
45 
46     /**
47      * Sets the visible state that this displayable should be, and whether the change should
48      * animate.
49      */
setVisibleState(@tatusBarIconView.VisibleState int state, boolean animate)50     void setVisibleState(@StatusBarIconView.VisibleState int state, boolean animate);
51 
52     /** Returns the current visible state of this displayable. */
53     @StatusBarIconView.VisibleState
getVisibleState()54     int getVisibleState();
55 
56     /**
57      * Returns true if this icon should be visible if there's space, and false otherwise.
58      *
59      * Note that this doesn't necessarily mean it *will* be visible. It's possible that there are
60      * more icons than space, in which case this icon might just show a dot or might be completely
61      * hidden. {@link #getVisibleState} will return the icon's actual visible status.
62      */
isIconVisible()63     boolean isIconVisible();
64 
isIconBlocked()65     default boolean isIconBlocked() {
66         return false;
67     }
68 }
69