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 22 /** 23 * Holds information about how to execute task transition animations. 24 * 25 * This class is intended to be used with IWindowManager.setTaskTransitionSpec methods when 26 * we want more customization over the way default task transitions are executed. 27 * 28 * @hide 29 */ 30 public class TaskTransitionSpec implements Parcelable { 31 /** 32 * The background color to use during task animations (override the default background color) 33 */ 34 public final int backgroundColor; 35 TaskTransitionSpec(int backgroundColor)36 public TaskTransitionSpec(int backgroundColor) { 37 this.backgroundColor = backgroundColor; 38 } 39 TaskTransitionSpec(Parcel in)40 public TaskTransitionSpec(Parcel in) { 41 this.backgroundColor = in.readInt(); 42 } 43 44 @Override describeContents()45 public int describeContents() { 46 return 0; 47 } 48 49 @Override writeToParcel(Parcel dest, int flags)50 public void writeToParcel(Parcel dest, int flags) { 51 dest.writeInt(backgroundColor); 52 } 53 54 public static final @android.annotation.NonNull Parcelable.Creator<TaskTransitionSpec> 55 CREATOR = new Parcelable.Creator<TaskTransitionSpec>() { 56 public TaskTransitionSpec createFromParcel(Parcel in) { 57 return new TaskTransitionSpec(in); 58 } 59 60 public TaskTransitionSpec[] newArray(int size) { 61 return new TaskTransitionSpec[size]; 62 } 63 }; 64 } 65