gd.java
4.85 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
import android.content.res.ColorStateList;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.support.v4.view.ViewCompat;
import android.support.v7.appcompat.R.styleable;
import android.support.v7.widget.AppCompatDrawableManager;
import android.support.v7.widget.DrawableUtils;
import android.support.v7.widget.TintTypedArray;
import android.util.AttributeSet;
import android.view.View;
public final class gd
{
private final View a;
private final AppCompatDrawableManager b;
private int c = -1;
private ha d;
private ha e;
private ha f;
public gd(View paramView)
{
this.a = paramView;
this.b = AppCompatDrawableManager.get();
}
private void b(ColorStateList paramColorStateList)
{
if (paramColorStateList != null)
{
if (this.d == null) {
this.d = new ha();
}
this.d.a = paramColorStateList;
this.d.d = true;
}
for (;;)
{
d();
return;
this.d = null;
}
}
public final void a()
{
this.c = -1;
b(null);
d();
}
public final void a(int paramInt)
{
this.c = paramInt;
if (this.b != null) {}
for (ColorStateList localColorStateList = this.b.b(this.a.getContext(), paramInt);; localColorStateList = null)
{
b(localColorStateList);
d();
return;
}
}
public final void a(ColorStateList paramColorStateList)
{
if (this.e == null) {
this.e = new ha();
}
this.e.a = paramColorStateList;
this.e.d = true;
d();
}
public final void a(PorterDuff.Mode paramMode)
{
if (this.e == null) {
this.e = new ha();
}
this.e.b = paramMode;
this.e.c = true;
d();
}
public final void a(AttributeSet paramAttributeSet, int paramInt)
{
paramAttributeSet = TintTypedArray.obtainStyledAttributes(this.a.getContext(), paramAttributeSet, R.styleable.ViewBackgroundHelper, paramInt, 0);
try
{
if (paramAttributeSet.hasValue(R.styleable.ViewBackgroundHelper_android_background))
{
this.c = paramAttributeSet.getResourceId(R.styleable.ViewBackgroundHelper_android_background, -1);
ColorStateList localColorStateList = this.b.b(this.a.getContext(), this.c);
if (localColorStateList != null) {
b(localColorStateList);
}
}
if (paramAttributeSet.hasValue(R.styleable.ViewBackgroundHelper_backgroundTint)) {
ViewCompat.setBackgroundTintList(this.a, paramAttributeSet.getColorStateList(R.styleable.ViewBackgroundHelper_backgroundTint));
}
if (paramAttributeSet.hasValue(R.styleable.ViewBackgroundHelper_backgroundTintMode)) {
ViewCompat.setBackgroundTintMode(this.a, DrawableUtils.a(paramAttributeSet.getInt(R.styleable.ViewBackgroundHelper_backgroundTintMode, -1), null));
}
return;
}
finally
{
paramAttributeSet.recycle();
}
}
public final ColorStateList b()
{
if (this.e != null) {
return this.e.a;
}
return null;
}
public final PorterDuff.Mode c()
{
if (this.e != null) {
return this.e.b;
}
return null;
}
public final void d()
{
int j = 0;
Drawable localDrawable = this.a.getBackground();
int i;
if (localDrawable != null)
{
i = Build.VERSION.SDK_INT;
if (i < 21) {
break label188;
}
if (i != 21) {
break label176;
}
i = 1;
if (i == 0) {
break label193;
}
if (this.f == null) {
this.f = new ha();
}
ha localha = this.f;
localha.a = null;
localha.d = false;
localha.b = null;
localha.c = false;
Object localObject = ViewCompat.getBackgroundTintList(this.a);
if (localObject != null)
{
localha.d = true;
localha.a = ((ColorStateList)localObject);
}
localObject = ViewCompat.getBackgroundTintMode(this.a);
if (localObject != null)
{
localha.c = true;
localha.b = ((PorterDuff.Mode)localObject);
}
if (!localha.d)
{
i = j;
if (!localha.c) {}
}
else
{
AppCompatDrawableManager.a(localDrawable, localha, this.a.getDrawableState());
i = 1;
}
if (i == 0) {
break label193;
}
}
label176:
label188:
label193:
do
{
return;
if (this.d != null)
{
i = 1;
break;
}
i = 0;
break;
if (this.e != null)
{
AppCompatDrawableManager.a(localDrawable, this.e, this.a.getDrawableState());
return;
}
} while (this.d == null);
AppCompatDrawableManager.a(localDrawable, this.d, this.a.getDrawableState());
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/gd.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/