• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.systemui.shade.domain.interactor
18 
19 import com.android.systemui.dagger.SysUISingleton
20 import kotlinx.coroutines.flow.Flow
21 
22 /**
23  * Expansion-related methods used throughout SysUI before the addition of the scene container as the
24  * top layer component. This interface exists to allow the scene container to fulfil
25  * NotificationPanelViewController's contracts with the rest of SysUI. Once the scene container is
26  * the only shade implementation in SysUI, the remaining implementation of this should be deleted
27  * after inlining all of its method bodies. No new calls to any of these methods should be added.
28  */
29 @SysUISingleton
30 @Deprecated("Use ShadeInteractor instead.")
31 interface PanelExpansionInteractor {
32     /**
33      * The amount by which the "panel" has been expanded (`0` when fully collapsed, `1` when fully
34      * expanded).
35      *
36      * This is a legacy concept from the time when the "panel" included the notification/QS shades
37      * as well as the keyguard (lockscreen and bouncer). This value is meant only for
38      * backwards-compatibility and should not be consumed by newer code.
39      */
40     @Deprecated("Use SceneInteractor.currentScene instead.") val legacyPanelExpansion: Flow<Float>
41 
42     /**
43      * Returns whether the shade height is greater than zero or the shade is expecting a synthesized
44      * down event.
45      */
46     @Deprecated("Use ShadeInteractor.isAnyExpanded instead.") val isPanelExpanded: Boolean
47 
48     /**
49      * This method should not be used anymore, you should probably use [.isShadeFullyOpen] instead.
50      * It was overused as indicating if shade is open or we're on keyguard/AOD. Moving forward we
51      * should be explicit about the what state we're checking.
52      *
53      * @return if panel is covering the screen, which means we're in expanded shade or keyguard/AOD
54      */
55     @Deprecated(
56         "depends on the state you check, use {@link #isShadeFullyExpanded()},\n" +
57             "{@link #isOnAod()}, {@link #isOnKeyguard()} instead."
58     )
59     val isFullyExpanded: Boolean
60 
61     /** Returns whether shade's height is zero. */
62     @Deprecated("Use !ShadeInteractor.isAnyExpanded instead") val isFullyCollapsed: Boolean
63 
64     /** Returns whether the shade is in the process of collapsing. */
65     @Deprecated("Use ShadeAnimationInteractor instead") val isCollapsing: Boolean
66 
67     /** Returns whether the shade is tracking touches for expand/collapse of the shade or QS. */
68     @Deprecated("Use sceneInteractor.isTransitionUserInputOngoing instead") val isTracking: Boolean
69 
70     /** Returns the StatusBarState. Note: System UI was formerly known simply as Status Bar. */
71     @Deprecated("Use SceneInteractor or ShadeInteractor instead") val barState: Int
72 
73     /** Returns whether status bar icons should be hidden when the shade is expanded. */
74     @Deprecated("No longer supported. Do not add new calls to this.")
shouldHideStatusBarIconsWhenExpandednull75     fun shouldHideStatusBarIconsWhenExpanded(): Boolean
76 }
77