Fabian Kozynski | f10b6ab | 2019-12-27 09:31:04 -0500 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.systemui.controls.ui |
| 18 | |
| 19 | import android.content.ComponentName |
| 20 | import android.service.controls.Control |
| 21 | import android.service.controls.actions.ControlAction |
Matt Pietal | 2223179 | 2020-01-23 09:51:09 -0500 | [diff] [blame] | 22 | import android.view.ViewGroup |
Fabian Kozynski | f10b6ab | 2019-12-27 09:31:04 -0500 | [diff] [blame] | 23 | |
| 24 | interface ControlsUiController { |
Fabian Kozynski | 8b54045 | 2020-02-04 15:16:30 -0500 | [diff] [blame] | 25 | val available: Boolean |
| 26 | |
Matt Pietal | 307b1ef | 2020-02-10 07:27:01 -0500 | [diff] [blame] | 27 | companion object { |
| 28 | public const val TAG = "ControlsUiController" |
Matt Pietal | f4b870b | 2020-04-17 17:11:36 -0400 | [diff] [blame] | 29 | public const val EXTRA_ANIMATE = "extra_animate" |
Matt Pietal | 307b1ef | 2020-02-10 07:27:01 -0500 | [diff] [blame] | 30 | } |
| 31 | |
Matt Pietal | f4b870b | 2020-04-17 17:11:36 -0400 | [diff] [blame] | 32 | fun show(parent: ViewGroup, dismissGlobalActions: Runnable) |
Matt Pietal | 2223179 | 2020-01-23 09:51:09 -0500 | [diff] [blame] | 33 | fun hide() |
Matt Pietal | e9440b7 | 2020-05-01 11:36:01 -0400 | [diff] [blame] | 34 | |
| 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 Kozynski | f10b6ab | 2019-12-27 09:31:04 -0500 | [diff] [blame] | 41 | fun onRefreshState(componentName: ComponentName, controls: List<Control>) |
| 42 | fun onActionResponse( |
| 43 | componentName: ComponentName, |
| 44 | controlId: String, |
| 45 | @ControlAction.ResponseResult response: Int |
| 46 | ) |
Matt Pietal | 2223179 | 2020-01-23 09:51:09 -0500 | [diff] [blame] | 47 | } |