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