Debian Codegraph @

core/java/android/view/TaskTransitionSpec.java

raw symbols SCIP
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 package android.view;
18
19 import android.os.Parcel;
20 import android.os.Parcelable;
21 import android.util.ArraySet;
22
23 import java.util.Set;
24
25 /**
26 * Holds information about how to execute task transition animations.
27 *
28 * This class is intended to be used with IWindowManager.setTaskTransitionSpec methods when
29 * we want more customization over the way default task transitions are executed.
30 *
31 * @hide
32 */
33 public class TaskTransitionSpec implements Parcelable {
34 /**
35 * The background color to use during task animations (override the default background color)
36 */
37 public final int backgroundColor;
38
39 /**
40 * TEMPORARY FIELD (b/202383002)
41 * TODO: Remove once we use surfaceflinger rounded corners on tasks rather than taskbar overlays
42 * or when shell transitions are fully enabled
43 *
44 * A set of {@InsetsState.InternalInsetsType}s we want to use as the source to set the bounds
45 * of the task during the animation. Used to make sure that task animate above the taskbar.
46 * Will also be used to crop to the frame size of the inset source to the inset size to prevent
47 * the taskbar rounded corners overlay from being invisible during task transition animation.
48 */
49 public final Set<Integer> animationBoundInsets;
50
51 public TaskTransitionSpec(
52 int backgroundColor, Set<Integer> animationBoundInsets) {
53 this.backgroundColor = backgroundColor;
54 this.animationBoundInsets = animationBoundInsets;
55 }
56
57 public TaskTransitionSpec(Parcel in) {
58 this.backgroundColor = in.readInt();
59
60 int animationBoundInsetsSize = in.readInt();
61 this.animationBoundInsets = new ArraySet<>(animationBoundInsetsSize);
62 for (int i = 0; i < animationBoundInsetsSize; i++) {
63 this.animationBoundInsets.add(in.readInt());
64 }
65 }
66
67 @Override
68 public int describeContents() {
69 return 0;
70 }
71
72 @Override
73 public void writeToParcel(Parcel dest, int flags) {
74 dest.writeInt(backgroundColor);
75
76 dest.writeInt(animationBoundInsets.size());
77 for (int insetType : animationBoundInsets) {
78 dest.writeInt(insetType);
79 }
80 }
81
82 public static final @android.annotation.NonNull Parcelable.Creator<TaskTransitionSpec>
83 CREATOR = new Parcelable.Creator<TaskTransitionSpec>() {
84 public TaskTransitionSpec createFromParcel(Parcel in) {
85 return new TaskTransitionSpec(in);
86 }
87
88 public TaskTransitionSpec[] newArray(int size) {
89 return new TaskTransitionSpec[size];
90 }
91 };
92 }