| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.window; |
| 18 |
|
| 19 |
import android.annotation.ColorInt; |
| 20 |
import android.annotation.NonNull; |
| 21 |
import android.annotation.Nullable; |
| 22 |
import android.os.Parcel; |
| 23 |
import android.os.Parcelable; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
public final class TaskFragmentAnimationParams implements Parcelable { |
| 31 |
|
| 32 |
|
| 33 |
public static final TaskFragmentAnimationParams DEFAULT = |
| 34 |
new TaskFragmentAnimationParams.Builder().build(); |
| 35 |
|
| 36 |
@ColorInt |
| 37 |
private final int mAnimationBackgroundColor; |
| 38 |
|
| 39 |
private TaskFragmentAnimationParams(@ColorInt int animationBackgroundColor) { |
| 40 |
mAnimationBackgroundColor = animationBackgroundColor; |
| 41 |
} |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
@ColorInt |
| 50 |
public int getAnimationBackgroundColor() { |
| 51 |
return mAnimationBackgroundColor; |
| 52 |
} |
| 53 |
|
| 54 |
private TaskFragmentAnimationParams(Parcel in) { |
| 55 |
mAnimationBackgroundColor = in.readInt(); |
| 56 |
} |
| 57 |
|
| 58 |
@Override |
| 59 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 60 |
dest.writeInt(mAnimationBackgroundColor); |
| 61 |
} |
| 62 |
|
| 63 |
@NonNull |
| 64 |
public static final Creator<TaskFragmentAnimationParams> CREATOR = |
| 65 |
new Creator<TaskFragmentAnimationParams>() { |
| 66 |
@Override |
| 67 |
public TaskFragmentAnimationParams createFromParcel(Parcel in) { |
| 68 |
return new TaskFragmentAnimationParams(in); |
| 69 |
} |
| 70 |
|
| 71 |
@Override |
| 72 |
public TaskFragmentAnimationParams[] newArray(int size) { |
| 73 |
return new TaskFragmentAnimationParams[size]; |
| 74 |
} |
| 75 |
}; |
| 76 |
|
| 77 |
@Override |
| 78 |
public String toString() { |
| 79 |
return "TaskFragmentAnimationParams{" |
| 80 |
+ " animationBgColor=" + Integer.toHexString(mAnimationBackgroundColor) |
| 81 |
+ "}"; |
| 82 |
} |
| 83 |
|
| 84 |
@Override |
| 85 |
public int hashCode() { |
| 86 |
return mAnimationBackgroundColor; |
| 87 |
} |
| 88 |
|
| 89 |
@Override |
| 90 |
public boolean equals(@Nullable Object obj) { |
| 91 |
if (!(obj instanceof TaskFragmentAnimationParams)) { |
| 92 |
return false; |
| 93 |
} |
| 94 |
final TaskFragmentAnimationParams other = (TaskFragmentAnimationParams) obj; |
| 95 |
return mAnimationBackgroundColor == other.mAnimationBackgroundColor; |
| 96 |
} |
| 97 |
|
| 98 |
@Override |
| 99 |
public int describeContents() { |
| 100 |
return 0; |
| 101 |
} |
| 102 |
|
| 103 |
|
| 104 |
public static final class Builder { |
| 105 |
|
| 106 |
@ColorInt |
| 107 |
private int mAnimationBackgroundColor = 0; |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
@NonNull |
| 118 |
public Builder setAnimationBackgroundColor(@ColorInt int color) { |
| 119 |
mAnimationBackgroundColor = color; |
| 120 |
return this; |
| 121 |
} |
| 122 |
|
| 123 |
|
| 124 |
@NonNull |
| 125 |
public TaskFragmentAnimationParams build() { |
| 126 |
return new TaskFragmentAnimationParams(mAnimationBackgroundColor); |
| 127 |
} |
| 128 |
} |
| 129 |
} |