| 1 |
/* |
| 2 |
* Copyright (C) 2021 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 |
|
| 18 |
package android.window; |
| 19 |
|
| 20 |
import android.window.BackEvent; |
| 21 |
|
| 22 |
/** |
| 23 |
* Interface that wraps a {@link OnBackInvokedCallback} object, to be stored in window manager |
| 24 |
* and called from back handling process when back is invoked. |
| 25 |
* |
| 26 |
* @hide |
| 27 |
*/ |
| 28 |
oneway interface IOnBackInvokedCallback { |
| 29 |
/** |
| 30 |
* Called when a back gesture has been started, or back button has been pressed down. |
| 31 |
* Wraps {@link OnBackInvokedCallback#onBackStarted(BackEvent)}. |
| 32 |
* |
| 33 |
* @param backEvent The {@link BackEvent} containing information about the touch or button press. |
| 34 |
*/ |
| 35 |
void onBackStarted(in BackEvent backEvent); |
| 36 |
|
| 37 |
/** |
| 38 |
* Called on back gesture progress. |
| 39 |
* Wraps {@link OnBackInvokedCallback#onBackProgressed(BackEvent)}. |
| 40 |
* |
| 41 |
* @param backEvent The {@link BackEvent} containing information about the latest touch point |
| 42 |
* and the progress that the back animation should seek to. |
| 43 |
*/ |
| 44 |
void onBackProgressed(in BackEvent backEvent); |
| 45 |
|
| 46 |
/** |
| 47 |
* Called when a back gesture or back button press has been cancelled. |
| 48 |
* Wraps {@link OnBackInvokedCallback#onBackCancelled()}. |
| 49 |
*/ |
| 50 |
void onBackCancelled(); |
| 51 |
|
| 52 |
/** |
| 53 |
* Called when a back gesture has been completed and committed, or back button pressed |
| 54 |
* has been released and committed. |
| 55 |
* Wraps {@link OnBackInvokedCallback#onBackInvoked()}. |
| 56 |
*/ |
| 57 |
void onBackInvoked(); |
| 58 |
} |