lmw
2023-06-16 03972ad1d3ce6ffe0be0395c0a4d5dcb4474031f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
package com.luck.picture.lib.style;
 
import android.os.Parcel;
import android.os.Parcelable;
 
import androidx.annotation.AnimRes;
 
/**
 * @author:luck
 * @date:2019-11-25 18:17
 * @describe:PictureSelector Activity动画管理Style
 */
public class PictureWindowAnimationStyle implements Parcelable {
    /**
     * 相册启动动画
     */
    @AnimRes
    public int activityEnterAnimation;
 
    /**
     * 相册退出动画
     */
    @AnimRes
    public int activityExitAnimation;
 
    /**
     * 预览界面启动动画
     */
    @AnimRes
    public int activityPreviewEnterAnimation;
 
    /**
     * 预览界面退出动画
     */
    @AnimRes
    public int activityPreviewExitAnimation;
 
    /**
     * 裁剪界面启动动画
     */
    @AnimRes
    public int activityCropEnterAnimation;
 
    /**
     * 裁剪界面退出动画
     */
    @AnimRes
    public int activityCropExitAnimation;
 
 
    public PictureWindowAnimationStyle() {
        super();
    }
 
    public PictureWindowAnimationStyle(@AnimRes int activityEnterAnimation,
                                       @AnimRes int activityExitAnimation) {
        super();
        this.activityEnterAnimation = activityEnterAnimation;
        this.activityExitAnimation = activityExitAnimation;
    }
 
    public PictureWindowAnimationStyle(@AnimRes int activityEnterAnimation,
                                       @AnimRes int activityExitAnimation,
                                       @AnimRes int activityPreviewEnterAnimation,
                                       @AnimRes int activityPreviewExitAnimation) {
        super();
        this.activityEnterAnimation = activityEnterAnimation;
        this.activityExitAnimation = activityExitAnimation;
        this.activityPreviewEnterAnimation = activityPreviewEnterAnimation;
        this.activityPreviewExitAnimation = activityPreviewExitAnimation;
    }
 
    /**
     * 全局所有动画样式
     *
     * @param enterAnimation
     * @param exitAnimation
     */
    public void ofAllAnimation(int enterAnimation, int exitAnimation) {
        this.activityEnterAnimation = enterAnimation;
        this.activityExitAnimation = exitAnimation;
 
        this.activityPreviewEnterAnimation = enterAnimation;
        this.activityPreviewExitAnimation = exitAnimation;
 
        this.activityCropEnterAnimation = enterAnimation;
        this.activityCropExitAnimation = exitAnimation;
 
    }
 
    @Override
    public int describeContents() {
        return 0;
    }
 
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.activityEnterAnimation);
        dest.writeInt(this.activityExitAnimation);
        dest.writeInt(this.activityPreviewEnterAnimation);
        dest.writeInt(this.activityPreviewExitAnimation);
        dest.writeInt(this.activityCropEnterAnimation);
        dest.writeInt(this.activityCropExitAnimation);
    }
 
    protected PictureWindowAnimationStyle(Parcel in) {
        this.activityEnterAnimation = in.readInt();
        this.activityExitAnimation = in.readInt();
        this.activityPreviewEnterAnimation = in.readInt();
        this.activityPreviewExitAnimation = in.readInt();
        this.activityCropEnterAnimation = in.readInt();
        this.activityCropExitAnimation = in.readInt();
    }
 
    public static final Creator<PictureWindowAnimationStyle> CREATOR = new Creator<PictureWindowAnimationStyle>() {
        @Override
        public PictureWindowAnimationStyle createFromParcel(Parcel source) {
            return new PictureWindowAnimationStyle(source);
        }
 
        @Override
        public PictureWindowAnimationStyle[] newArray(int size) {
            return new PictureWindowAnimationStyle[size];
        }
    };
}