gu.java
3.98 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import android.annotation.TargetApi;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.support.annotation.RequiresApi;
@TargetApi(21)
@RequiresApi(21)
final class gu
extends Drawable
{
float a;
float b;
boolean c = false;
boolean d = true;
ColorStateList e;
private final Paint f;
private final RectF g;
private final Rect h;
private PorterDuffColorFilter i;
private ColorStateList j;
private PorterDuff.Mode k = PorterDuff.Mode.SRC_IN;
public gu(ColorStateList paramColorStateList, float paramFloat)
{
this.a = paramFloat;
this.f = new Paint(5);
a(paramColorStateList);
this.g = new RectF();
this.h = new Rect();
}
private PorterDuffColorFilter a(ColorStateList paramColorStateList, PorterDuff.Mode paramMode)
{
if ((paramColorStateList == null) || (paramMode == null)) {
return null;
}
return new PorterDuffColorFilter(paramColorStateList.getColorForState(getState(), 0), paramMode);
}
final void a(ColorStateList paramColorStateList)
{
ColorStateList localColorStateList = paramColorStateList;
if (paramColorStateList == null) {
localColorStateList = ColorStateList.valueOf(0);
}
this.e = localColorStateList;
this.f.setColor(this.e.getColorForState(getState(), this.e.getDefaultColor()));
}
final void a(Rect paramRect)
{
Rect localRect = paramRect;
if (paramRect == null) {
localRect = getBounds();
}
this.g.set(localRect.left, localRect.top, localRect.right, localRect.bottom);
this.h.set(localRect);
if (this.c)
{
float f1 = gv.a(this.b, this.a, this.d);
float f2 = gv.b(this.b, this.a, this.d);
this.h.inset((int)Math.ceil(f2), (int)Math.ceil(f1));
this.g.set(this.h);
}
}
public final void draw(Canvas paramCanvas)
{
Paint localPaint = this.f;
if ((this.i != null) && (localPaint.getColorFilter() == null)) {
localPaint.setColorFilter(this.i);
}
for (int m = 1;; m = 0)
{
paramCanvas.drawRoundRect(this.g, this.a, this.a, localPaint);
if (m != 0) {
localPaint.setColorFilter(null);
}
return;
}
}
public final int getOpacity()
{
return -3;
}
public final void getOutline(Outline paramOutline)
{
paramOutline.setRoundRect(this.h, this.a);
}
public final boolean isStateful()
{
return ((this.j != null) && (this.j.isStateful())) || ((this.e != null) && (this.e.isStateful())) || (super.isStateful());
}
protected final void onBoundsChange(Rect paramRect)
{
super.onBoundsChange(paramRect);
a(paramRect);
}
protected final boolean onStateChange(int[] paramArrayOfInt)
{
int m = this.e.getColorForState(paramArrayOfInt, this.e.getDefaultColor());
if (m != this.f.getColor()) {}
for (boolean bool = true;; bool = false)
{
if (bool) {
this.f.setColor(m);
}
if ((this.j == null) || (this.k == null)) {
break;
}
this.i = a(this.j, this.k);
return true;
}
return bool;
}
public final void setAlpha(int paramInt)
{
this.f.setAlpha(paramInt);
}
public final void setColorFilter(ColorFilter paramColorFilter)
{
this.f.setColorFilter(paramColorFilter);
}
public final void setTintList(ColorStateList paramColorStateList)
{
this.j = paramColorStateList;
this.i = a(this.j, this.k);
invalidateSelf();
}
public final void setTintMode(PorterDuff.Mode paramMode)
{
this.k = paramMode;
this.i = a(this.j, this.k);
invalidateSelf();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/gu.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/