kimi
2021-02-18 749a5510a9f014446a3cd6ba57b3cb0cc8148dc1
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
package com.mylhyl.circledialog.params;
 
import android.graphics.Typeface;
import android.os.Parcel;
import android.os.Parcelable;
 
import com.mylhyl.circledialog.res.values.CircleColor;
import com.mylhyl.circledialog.res.values.CircleDimen;
 
/**
 * LottieAnimationView参数
 * Created by hupei on 2018/7/7.
 */
public class LottieParams implements Parcelable {
 
    public static final Creator<LottieParams> CREATOR = new Creator<LottieParams>() {
        @Override
        public LottieParams createFromParcel(Parcel source) {
            return new LottieParams(source);
        }
 
        @Override
        public LottieParams[] newArray(int size) {
            return new LottieParams[size];
        }
    };
 
    /**
     * 进度条与body的边距 [left, top, right, bottom]
     */
    public int[] margins;
    /**
     * 底部文字内边距 [left, top, right, bottom]
     */
    public int[] textPadding;
    public int[] textMargins = CircleDimen.LOTTIE_TEXT_MARGINS;
    public int lottieHeight = CircleDimen.LOTTIE_HEIGHT;
    public int lottieWidth = CircleDimen.LOTTIE_WIDTH;
    public int animationResId;
    public String animationFileName;
    public String imageAssetsFolder;
    public boolean autoPlay;
    public boolean loop;
    /**
     * 加载文字
     */
    public String text = "";
    /**
     * body背景颜色
     */
    public int backgroundColor;
    /**
     * 文本字体颜色
     */
    public int textColor = CircleColor.LOADING_TEXT;
    /**
     * 文本字体大小
     */
    public int textSize = CircleDimen.LOADING_TEXT_SIZE;
    /**
     * 字样式
     * {@linkplain Typeface#NORMAL NORMAL}
     * {@linkplain Typeface#BOLD BOLD}
     * {@linkplain Typeface#ITALIC ITALIC}
     * {@linkplain Typeface#BOLD_ITALIC BOLD_ITALIC}
     */
    public int styleText = Typeface.NORMAL;
 
    public LottieParams() {
    }
 
    protected LottieParams(Parcel in) {
        this.margins = in.createIntArray();
        this.textPadding = in.createIntArray();
        this.textMargins = in.createIntArray();
        this.lottieHeight = in.readInt();
        this.lottieWidth = in.readInt();
        this.animationResId = in.readInt();
        this.animationFileName = in.readString();
        this.imageAssetsFolder = in.readString();
        this.autoPlay = in.readByte() != 0;
        this.loop = in.readByte() != 0;
        this.text = in.readString();
        this.backgroundColor = in.readInt();
        this.textColor = in.readInt();
        this.textSize = in.readInt();
        this.styleText = in.readInt();
    }
 
    @Override
    public int describeContents() {
        return 0;
    }
 
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeIntArray(this.margins);
        dest.writeIntArray(this.textPadding);
        dest.writeIntArray(this.textMargins);
        dest.writeInt(this.lottieHeight);
        dest.writeInt(this.lottieWidth);
        dest.writeInt(this.animationResId);
        dest.writeString(this.animationFileName);
        dest.writeString(this.imageAssetsFolder);
        dest.writeByte(this.autoPlay ? (byte) 1 : (byte) 0);
        dest.writeByte(this.loop ? (byte) 1 : (byte) 0);
        dest.writeString(this.text);
        dest.writeInt(this.backgroundColor);
        dest.writeInt(this.textColor);
        dest.writeInt(this.textSize);
        dest.writeInt(this.styleText);
    }
}