1 /*
2  * Copyright (C) 2023 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.tools.traces.wm
18 
19 enum class TransitionType(val value: Int) {
20     UNDEFINED(-1),
21     NONE(0),
22     OPEN(1),
23     CLOSE(2),
24     TO_FRONT(3),
25     TO_BACK(4),
26     RELAUNCH(5),
27     CHANGE(6),
28     KEYGUARD_GOING_AWAY(7),
29     KEYGUARD_OCCLUDE(8),
30     KEYGUARD_UNOCCLUDE(9),
31     PIP(10),
32     WAKE(11),
33     SLEEP(12),
34 
35     // START OF CUSTOM TYPES
36     FIRST_CUSTOM(1000),
37     EXIT_PIP(FIRST_CUSTOM.value + 1),
38     EXIT_PIP_TO_SPLIT(FIRST_CUSTOM.value + 2),
39     REMOVE_PIP(FIRST_CUSTOM.value + 3),
40     SPLIT_SCREEN_PAIR_OPEN(FIRST_CUSTOM.value + 4),
41     SPLIT_SCREEN_OPEN_TO_SIDE(FIRST_CUSTOM.value + 5),
42     SPLIT_DISMISS_SNAP(FIRST_CUSTOM.value + 6),
43     SPLIT_DISMISS(FIRST_CUSTOM.value + 7),
44     MAXIMIZE(FIRST_CUSTOM.value + 8),
45     RESTORE_FROM_MAXIMIZE(FIRST_CUSTOM.value + 9),
46     DESKTOP_MODE_START_DRAG_TO_DESKTOP(FIRST_CUSTOM.value + 10),
47     DESKTOP_MODE_END_DRAG_TO_DESKTOP(FIRST_CUSTOM.value + 11),
48     EXIT_DESKTOP_MODE(FIRST_CUSTOM.value + 12),
49     DESKTOP_MODE_CANCEL_DRAG_TO_DESKTOP(FIRST_CUSTOM.value + 13),
50     DESKTOP_MODE_TOGGLE_RESIZE(FIRST_CUSTOM.value + 14),
51     MOVE_TO_DESKTOP(FIRST_CUSTOM.value + 15),
52     RESIZE_PIP(FIRST_CUSTOM.value + 16);
53 
54     companion object {
<lambda>null55         fun fromInt(value: Int) = entries.first { it.value == value }
56     }
57 }
58