Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 android.view; |
| 18 | |
| 19 | import android.view.WindowInsets.Type.InsetType; |
| 20 | |
| 21 | /** |
| 22 | * Interface to control windows that generate insets. |
| 23 | * |
| 24 | * TODO Needs more information and examples once the API is more baked. |
| 25 | * @hide pending unhide |
| 26 | */ |
| 27 | public interface WindowInsetsController { |
| 28 | |
| 29 | /** |
| 30 | * Makes a set of windows that cause insets appear on screen. |
| 31 | * <p> |
| 32 | * Note that if the window currently doesn't have control over a certain type, it will apply the |
| 33 | * change as soon as the window gains control. The app can listen to the event by observing |
| 34 | * {@link View#onApplyWindowInsets} and checking visibility with "TODO at method" in |
| 35 | * {@link WindowInsets}. |
| 36 | * |
| 37 | * @param types A bitmask of {@link WindowInsets.Type.InsetType} specifying what windows the app |
| 38 | * would like to make appear on screen. |
| 39 | */ |
| 40 | void show(@InsetType int types); |
| 41 | |
| 42 | /** |
| 43 | * Makes a set of windows causing insets disappear. |
| 44 | * <p> |
| 45 | * Note that if the window currently doesn't have control over a certain type, it will apply the |
| 46 | * change as soon as the window gains control. The app can listen to the event by observing |
| 47 | * {@link View#onApplyWindowInsets} and checking visibility with "TODO at method" in |
| 48 | * {@link WindowInsets}. |
| 49 | * |
| 50 | * @param types A bitmask of {@link WindowInsets.Type.InsetType} specifying what windows the app |
| 51 | * would like to make disappear. |
| 52 | */ |
| 53 | void hide(@InsetType int types); |
| 54 | } |