• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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 package com.android.systemui.shade
17 
18 import com.android.systemui.shade.domain.interactor.PanelExpansionInteractor
19 import com.android.systemui.shade.domain.interactor.ShadeBackActionInteractor
20 import com.android.systemui.shade.domain.interactor.ShadeLockscreenInteractor
21 import com.android.systemui.statusbar.GestureRecorder
22 import com.android.systemui.statusbar.notification.headsup.HeadsUpManager
23 import com.android.systemui.statusbar.phone.CentralSurfaces
24 
25 /**
26  * Allows CentralSurfacesImpl to interact with the shade. Only CentralSurfacesImpl should reference
27  * this class. If any method in this class is needed outside of CentralSurfacesImpl, it must be
28  * pulled up into ShadeViewController.
29  */
30 interface ShadeSurface :
31     ShadeViewController,
32     ShadeBackActionInteractor,
33     ShadeLockscreenInteractor,
34     PanelExpansionInteractor {
35     /** Initialize objects instead of injecting to avoid circular dependencies. */
initDependenciesnull36     fun initDependencies(
37         centralSurfaces: CentralSurfaces,
38         recorder: GestureRecorder,
39         hideExpandedRunnable: Runnable,
40         headsUpManager: HeadsUpManager,
41     )
42 
43     /** Cancels any pending collapses. */
44     fun cancelPendingCollapse()
45 
46     /** Cancels the views current animation. */
47     fun cancelAnimation()
48 
49     /** Animates the view from its current alpha to zero then runs the runnable. */
50     fun fadeOut(startDelayMs: Long, durationMs: Long, endAction: Runnable)
51 
52     /** Set whether the bouncer is showing. */
53     fun setBouncerShowing(bouncerShowing: Boolean)
54 
55     /**
56      * Sets whether the shade can handle touches and/or animate, canceling any touch handling or
57      * animations in progress.
58      */
59     fun setTouchAndAnimationDisabled(disabled: Boolean)
60 
61     /**
62      * Sets the dozing state.
63      *
64      * @param dozing `true` when dozing.
65      * @param animate if transition should be animated.
66      */
67     fun setDozing(dozing: Boolean, animate: Boolean)
68 
69     /** @see view.setImportantForAccessibility */
70     fun setImportantForAccessibility(mode: Int)
71 
72     /** Sets the view's X translation to zero. */
73     fun resetTranslation()
74 
75     /** Sets the view's alpha to max. */
76     fun resetAlpha()
77 
78     /**
79      * Called when the device's theme changes.
80      *
81      * TODO(b/274655539) delete?
82      */
83     fun onThemeChanged()
84 
85     /** Updates the shade expansion and [NotificationPanelView] visibility if necessary. */
86     fun updateExpansionAndVisibility()
87 
88     /** Updates all field values drawn from Resources. */
89     fun updateResources()
90 }
91