blob: 4e4c82cabaa099353346343213e2ae5e512bc60a [file] [log] [blame]
Fabian Kozynskif10b6ab2019-12-27 09:31:04 -05001/*
2 * Copyright (C) 2020 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
17package com.android.systemui.controls.ui
18
19import android.content.ComponentName
20import android.service.controls.Control
21import android.service.controls.actions.ControlAction
Matt Pietal22231792020-01-23 09:51:09 -050022import android.view.ViewGroup
Fabian Kozynskif10b6ab2019-12-27 09:31:04 -050023
24interface ControlsUiController {
Fabian Kozynski8b540452020-02-04 15:16:30 -050025 val available: Boolean
26
Matt Pietal307b1ef2020-02-10 07:27:01 -050027 companion object {
28 public const val TAG = "ControlsUiController"
Matt Pietalf4b870b2020-04-17 17:11:36 -040029 public const val EXTRA_ANIMATE = "extra_animate"
Matt Pietal307b1ef2020-02-10 07:27:01 -050030 }
31
Matt Pietalf4b870b2020-04-17 17:11:36 -040032 fun show(parent: ViewGroup, dismissGlobalActions: Runnable)
Matt Pietal22231792020-01-23 09:51:09 -050033 fun hide()
Matt Pietale9440b72020-05-01 11:36:01 -040034
35 /**
36 * Request all open dialogs be closed. Set [immediately] to true to dismiss without
37 * animations.
38 */
39 fun closeDialogs(immediately: Boolean)
40
Fabian Kozynskif10b6ab2019-12-27 09:31:04 -050041 fun onRefreshState(componentName: ComponentName, controls: List<Control>)
42 fun onActionResponse(
43 componentName: ComponentName,
44 controlId: String,
45 @ControlAction.ResponseResult response: Int
46 )
Matt Pietal22231792020-01-23 09:51:09 -050047}