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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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;
 
/**
 * 进度条参数
 * Created by hupei on 2017/3/31.
 */
public class ProgressParams implements Parcelable {
 
    /**
     * 水平进度条
     */
    public static final int STYLE_HORIZONTAL = 0;
    /**
     * 旋转进度条
     */
    public static final int STYLE_SPINNER = 1;
    public static final Creator<ProgressParams> CREATOR = new Creator<ProgressParams>() {
        @Override
        public ProgressParams createFromParcel(Parcel source) {
            return new ProgressParams(source);
        }
 
        @Override
        public ProgressParams[] newArray(int size) {
            return new ProgressParams[size];
        }
    };
 
    /**
     * 进度条样式,默认水平样式
     */
    public int style = STYLE_HORIZONTAL;
    /**
     * 进度条与body的边距 [left, top, right, bottom]
     */
    public int[] margins = CircleDimen.PROGRESS_MARGINS;
    /**
     * 底部文字内边距 [left, top, right, bottom]
     */
    public int[] padding = CircleDimen.PROGRESS_TEXT_PADDING;
    /**
     * 进度条资源背景
     */
    public int progressDrawableId;
    /**
     * 进度条高度
     */
    public int progressHeight;
    /**
     * 最大刻度
     */
    public int max;
    /**
     * 刻度
     */
    public int progress;
    /**
     * 进度条显示的文字,支持String.format() 例如:已经下载%s
     */
    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;
 
    /**
     * 只对圈圈颜色有效 RGB颜色值
     *
     * @since 5.0.5
     */
    public int indeterminateColor;
 
    public ProgressParams() {
    }
 
    protected ProgressParams(Parcel in) {
        this.style = in.readInt();
        this.margins = in.createIntArray();
        this.padding = in.createIntArray();
        this.progressDrawableId = in.readInt();
        this.progressHeight = in.readInt();
        this.max = in.readInt();
        this.progress = in.readInt();
        this.text = in.readString();
        this.backgroundColor = in.readInt();
        this.textColor = in.readInt();
        this.textSize = in.readInt();
        this.styleText = in.readInt();
        this.indeterminateColor = in.readInt();
    }
 
    @Override
    public int describeContents() {
        return 0;
    }
 
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.style);
        dest.writeIntArray(this.margins);
        dest.writeIntArray(this.padding);
        dest.writeInt(this.progressDrawableId);
        dest.writeInt(this.progressHeight);
        dest.writeInt(this.max);
        dest.writeInt(this.progress);
        dest.writeString(this.text);
        dest.writeInt(this.backgroundColor);
        dest.writeInt(this.textColor);
        dest.writeInt(this.textSize);
        dest.writeInt(this.styleText);
        dest.writeInt(this.indeterminateColor);
    }
}