AttrSet.java
2.11 KB
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
package com.wd.common.widget;
import android.content.res.ColorStateList;
public class AttrSet {
private float[] radii = new float[8]; // top-left, top-right, bottom-right, bottom-left
private ColorStateList maskColor;
private ColorStateList strokeColor;
private float strokeWidth;
private boolean clipBackground;
public float getRadiusTopLeft() {
return radii[0];
}
public void setRadiusTopLeft(float radiusTopLeft) {
this.radii[0] = radiusTopLeft;
this.radii[1] = radiusTopLeft;
}
public float getRadiusTopRight() {
return radii[2];
}
public void setRadiusTopRight(float radiusTopRight) {
this.radii[2] = radiusTopRight;
this.radii[3] = radiusTopRight;
}
public float getRadiusBottomRight() {
return radii[4];
}
public void setRadiusBottomRight(float radiusBottomRight) {
this.radii[4] = radiusBottomRight;
this.radii[5] = radiusBottomRight;
}
public float getRadiusBottomLeft() {
return radii[6];
}
public void setRadiusBottomLeft(float radiusBottomLeft) {
this.radii[6] = radiusBottomLeft;
this.radii[7] = radiusBottomLeft;
}
public float[] getRadii() {
return radii;
}
public void setRadius(float radius) {
for (int i = 0; i < this.radii.length; i++) {
this.radii[i] = radius;
}
}
public ColorStateList getStrokeColor() {
return strokeColor;
}
public void setStrokeColor(ColorStateList strokeColor) {
this.strokeColor = strokeColor;
}
public float getStrokeWidth() {
return strokeWidth;
}
public void setStrokeWidth(float strokeWidth) {
this.strokeWidth = strokeWidth;
}
public ColorStateList getMaskColor() {
return maskColor;
}
public void setMaskColor(ColorStateList maskColor) {
this.maskColor = maskColor;
}
public boolean isClipBackground() {
return clipBackground;
}
public void setClipBackground(boolean clipBackground) {
this.clipBackground = clipBackground;
}
}