1 package android.view; 2 3 import android.graphics.Bitmap; 4 import android.graphics.Rect; 5 import android.os.Parcel; 6 import 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 */ 16 public 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 } 62