blob: c6e1989e8b55d6f76ed074b021388538f41585ea [file] [log] [blame]
Filip Gruszczynski170192a2015-08-16 17:46:34 -07001package android.view;
2
3import android.graphics.Bitmap;
4import android.graphics.Rect;
5import android.os.Parcel;
6import android.os.Parcelable;
7
8/**
9 * Holds information about how the next app transition animation should be executed.
10 *
11 * This class is intended to be used with IWindowManager.overridePendingAppTransition* methods when
12 * simple arguments are not enough to describe the animation.
13 *
14 * @hide
15 */
16public class AppTransitionAnimationSpec implements Parcelable {
17 public final int taskId;
18 public final Bitmap bitmap;
19 public final Rect rect;
20
21 public AppTransitionAnimationSpec(int taskId, Bitmap bitmap, Rect rect) {
22 this.taskId = taskId;
23 this.bitmap = bitmap;
24 this.rect = rect;
25 }
26
27 public AppTransitionAnimationSpec(Parcel in) {
28 taskId = in.readInt();
29 bitmap = in.readParcelable(null);
30 rect = in.readParcelable(null);
31 }
32
33 @Override
34 public int describeContents() {
35 return 0;
36 }
37
38 @Override
39 public void writeToParcel(Parcel dest, int flags) {
40 dest.writeInt(taskId);
41 dest.writeParcelable(bitmap, 0 /* flags */);
42 dest.writeParcelable(rect, 0 /* flags */);
43
44 }
45
46 public static final Parcelable.Creator<AppTransitionAnimationSpec> CREATOR
47 = new Parcelable.Creator<AppTransitionAnimationSpec>() {
48 public AppTransitionAnimationSpec createFromParcel(Parcel in) {
49 return new AppTransitionAnimationSpec(in);
50 }
51
52 public AppTransitionAnimationSpec[] newArray(int size) {
53 return new AppTransitionAnimationSpec[size];
54 }
55 };
56
57 @Override
58 public String toString() {
59 return "{taskId: " + taskId + ", bitmap: " + bitmap + ", rect: " + rect + "}";
60 }
61}