Jorim Jaggi | 5bb571d | 2018-11-06 14:42:04 +0100 | [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.annotation.NonNull; |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 20 | import android.view.WindowInsets.Type.InsetsType; |
Jorim Jaggi | 5bb571d | 2018-11-06 14:42:04 +0100 | [diff] [blame] | 21 | import android.view.inputmethod.EditorInfo; |
| 22 | |
| 23 | /** |
| 24 | * Interface that informs the client about {@link WindowInsetsAnimationController} state changes. |
| 25 | * @hide pending unhide |
| 26 | */ |
| 27 | public interface WindowInsetsAnimationControlListener { |
| 28 | |
| 29 | /** |
| 30 | * Gets called as soon as the animation is ready to be controlled. This may be |
| 31 | * delayed when the IME needs to redraw because of an {@link EditorInfo} change, or when the |
| 32 | * window is starting up. |
| 33 | * |
| 34 | * @param controller The controller to control the inset animation. |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 35 | * @param types The {@link InsetsType}s it was able to gain control over. Note that this may be |
Jorim Jaggi | 5bb571d | 2018-11-06 14:42:04 +0100 | [diff] [blame] | 36 | * different than the types passed into |
| 37 | * {@link WindowInsetsController#controlWindowInsetsAnimation} in case the window |
| 38 | * wasn't able to gain the controls because it wasn't the IME target or not |
| 39 | * currently the window that's controlling the system bars. |
| 40 | */ |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 41 | void onReady(@NonNull WindowInsetsAnimationController controller, @InsetsType int types); |
Jorim Jaggi | 5bb571d | 2018-11-06 14:42:04 +0100 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * Called when the window no longer has control over the requested types. If it loses control |
| 45 | * over one type, the whole control will be cancelled. If none of the requested types were |
| 46 | * available when requesting the control, the animation control will be cancelled immediately |
| 47 | * without {@link #onReady} being called. |
| 48 | */ |
| 49 | void onCancelled(); |
| 50 | } |