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
package com.mylhyl.circledialog.params;
 
import android.os.Parcel;
import android.os.Parcelable;
 
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
 
import androidx.annotation.IntDef;
 
/**
 * Created by hupei on 2019/1/16 14:14.
 */
public class CloseParams implements Parcelable {
 
    /**
     * 关闭按钮在上左
     */
    public static final int CLOSE_TOP_LEFT = 351;
    /**
     * 关闭按钮在上右
     */
    public static final int CLOSE_TOP_RIGHT = 353;
    /**
     * 关闭按钮在上中
     */
    public static final int CLOSE_TOP_CENTER = 349;
 
    /**
     * 关闭按钮在下左
     */
    public static final int CLOSE_BOTTOM_LEFT = 783;
    /**
     * 关闭按钮在下右
     */
    public static final int CLOSE_BOTTOM_RIGHT = 785;
    /**
     * 关闭按钮在下中
     */
    public static final int CLOSE_BOTTOM_CENTER = 781;
    public static final Parcelable.Creator<CloseParams> CREATOR = new Parcelable.Creator<CloseParams>() {
        @Override
        public CloseParams createFromParcel(Parcel source) {
            return new CloseParams(source);
        }
 
        @Override
        public CloseParams[] newArray(int size) {
            return new CloseParams[size];
        }
    };
    public int closeResId;
    /**
     * 关闭图标的大小 dp
     */
    public int closeSize;
    /**
     * 关闭按钮的内间距 dp
     * int left, int top, int right, int bottom
     */
    public int[] closePadding;
    /**
     * 关闭按钮位置
     */
    public @CloseGravity
    int closeGravity = CLOSE_TOP_RIGHT;
    /**
     * 与边框的连接线宽度,默认0,只有大于0才显示 dp
     */
    public int connectorWidth;
    /**
     * 与边框的连接线高度 dp
     */
    public int connectorHeight;
    /**
     * 与边框的连接线颜色值 RGB
     */
    public int connectorColor = 0xFFFFFFFF;
 
    public CloseParams() {
    }
 
    protected CloseParams(Parcel in) {
        this.closeResId = in.readInt();
        this.closeSize = in.readInt();
        this.closePadding = in.createIntArray();
        this.closeGravity = in.readInt();
    }
 
    @Override
    public int describeContents() {
        return 0;
    }
 
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.closeResId);
        dest.writeInt(this.closeSize);
        dest.writeIntArray(this.closePadding);
        dest.writeInt(this.closeGravity);
    }
 
    @IntDef({CLOSE_TOP_LEFT, CLOSE_TOP_RIGHT, CLOSE_TOP_CENTER
            , CLOSE_BOTTOM_LEFT, CLOSE_BOTTOM_RIGHT, CLOSE_BOTTOM_CENTER})
    @Retention(RetentionPolicy.SOURCE)
    public @interface CloseGravity {
    }
}