CardView.java
8.24 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
package android.support.v7.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.support.annotation.ColorInt;
import android.support.annotation.Nullable;
import android.support.v7.cardview.R.color;
import android.support.v7.cardview.R.style;
import android.support.v7.cardview.R.styleable;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.MeasureSpec;
import android.widget.FrameLayout;
import gj;
import gk;
import gl;
import gm;
import gn;
public class CardView
extends FrameLayout
{
private static final int[] e = { 16842801 };
private static final gm f;
int a;
int b;
final Rect c = new Rect();
final Rect d = new Rect();
private boolean g;
private boolean h;
private final gk i = new gk()
{
private Drawable b;
public final void a(int paramAnonymousInt1, int paramAnonymousInt2)
{
if (paramAnonymousInt1 > CardView.this.a) {
CardView.a(CardView.this, paramAnonymousInt1);
}
if (paramAnonymousInt2 > CardView.this.b) {
CardView.b(CardView.this, paramAnonymousInt2);
}
}
public final void a(int paramAnonymousInt1, int paramAnonymousInt2, int paramAnonymousInt3, int paramAnonymousInt4)
{
CardView.this.d.set(paramAnonymousInt1, paramAnonymousInt2, paramAnonymousInt3, paramAnonymousInt4);
CardView.a(CardView.this, CardView.this.c.left + paramAnonymousInt1, CardView.this.c.top + paramAnonymousInt2, CardView.this.c.right + paramAnonymousInt3, CardView.this.c.bottom + paramAnonymousInt4);
}
public final void a(Drawable paramAnonymousDrawable)
{
this.b = paramAnonymousDrawable;
CardView.this.setBackgroundDrawable(paramAnonymousDrawable);
}
public final boolean a()
{
return CardView.this.getUseCompatPadding();
}
public final boolean b()
{
return CardView.this.getPreventCornerOverlap();
}
public final Drawable c()
{
return this.b;
}
public final View d()
{
return CardView.this;
}
};
static
{
if (Build.VERSION.SDK_INT >= 21) {
f = new gj();
}
for (;;)
{
f.a();
return;
if (Build.VERSION.SDK_INT >= 17) {
f = new gn();
} else {
f = new gl();
}
}
}
public CardView(Context paramContext)
{
super(paramContext);
a(paramContext, null, 0);
}
public CardView(Context paramContext, AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
a(paramContext, paramAttributeSet, 0);
}
public CardView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
a(paramContext, paramAttributeSet, paramInt);
}
private void a(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
TypedArray localTypedArray = paramContext.obtainStyledAttributes(paramAttributeSet, R.styleable.CardView, paramInt, R.style.CardView);
if (localTypedArray.hasValue(R.styleable.CardView_cardBackgroundColor))
{
paramAttributeSet = localTypedArray.getColorStateList(R.styleable.CardView_cardBackgroundColor);
float f4 = localTypedArray.getDimension(R.styleable.CardView_cardCornerRadius, 0.0F);
float f2 = localTypedArray.getDimension(R.styleable.CardView_cardElevation, 0.0F);
float f3 = localTypedArray.getDimension(R.styleable.CardView_cardMaxElevation, 0.0F);
this.g = localTypedArray.getBoolean(R.styleable.CardView_cardUseCompatPadding, false);
this.h = localTypedArray.getBoolean(R.styleable.CardView_cardPreventCornerOverlap, true);
paramInt = localTypedArray.getDimensionPixelSize(R.styleable.CardView_contentPadding, 0);
this.c.left = localTypedArray.getDimensionPixelSize(R.styleable.CardView_contentPaddingLeft, paramInt);
this.c.top = localTypedArray.getDimensionPixelSize(R.styleable.CardView_contentPaddingTop, paramInt);
this.c.right = localTypedArray.getDimensionPixelSize(R.styleable.CardView_contentPaddingRight, paramInt);
this.c.bottom = localTypedArray.getDimensionPixelSize(R.styleable.CardView_contentPaddingBottom, paramInt);
float f1 = f3;
if (f2 > f3) {
f1 = f2;
}
this.a = localTypedArray.getDimensionPixelSize(R.styleable.CardView_android_minWidth, 0);
this.b = localTypedArray.getDimensionPixelSize(R.styleable.CardView_android_minHeight, 0);
localTypedArray.recycle();
f.a(this.i, paramContext, paramAttributeSet, f4, f2, f1);
return;
}
paramAttributeSet = getContext().obtainStyledAttributes(e);
paramInt = paramAttributeSet.getColor(0, 0);
paramAttributeSet.recycle();
paramAttributeSet = new float[3];
Color.colorToHSV(paramInt, paramAttributeSet);
if (paramAttributeSet[2] > 0.5F) {}
for (paramInt = getResources().getColor(R.color.cardview_light_background);; paramInt = getResources().getColor(R.color.cardview_dark_background))
{
paramAttributeSet = ColorStateList.valueOf(paramInt);
break;
}
}
public ColorStateList getCardBackgroundColor()
{
return f.i(this.i);
}
public float getCardElevation()
{
return f.e(this.i);
}
public int getContentPaddingBottom()
{
return this.c.bottom;
}
public int getContentPaddingLeft()
{
return this.c.left;
}
public int getContentPaddingRight()
{
return this.c.right;
}
public int getContentPaddingTop()
{
return this.c.top;
}
public float getMaxCardElevation()
{
return f.a(this.i);
}
public boolean getPreventCornerOverlap()
{
return this.h;
}
public float getRadius()
{
return f.d(this.i);
}
public boolean getUseCompatPadding()
{
return this.g;
}
protected void onMeasure(int paramInt1, int paramInt2)
{
if (!(f instanceof gj))
{
int j = View.MeasureSpec.getMode(paramInt1);
switch (j)
{
default:
j = View.MeasureSpec.getMode(paramInt2);
switch (j)
{
}
break;
}
for (;;)
{
super.onMeasure(paramInt1, paramInt2);
return;
paramInt1 = View.MeasureSpec.makeMeasureSpec(Math.max((int)Math.ceil(f.b(this.i)), View.MeasureSpec.getSize(paramInt1)), j);
break;
paramInt2 = View.MeasureSpec.makeMeasureSpec(Math.max((int)Math.ceil(f.c(this.i)), View.MeasureSpec.getSize(paramInt2)), j);
}
}
super.onMeasure(paramInt1, paramInt2);
}
public void setCardBackgroundColor(@ColorInt int paramInt)
{
f.a(this.i, ColorStateList.valueOf(paramInt));
}
public void setCardBackgroundColor(@Nullable ColorStateList paramColorStateList)
{
f.a(this.i, paramColorStateList);
}
public void setCardElevation(float paramFloat)
{
f.c(this.i, paramFloat);
}
public void setContentPadding(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
this.c.set(paramInt1, paramInt2, paramInt3, paramInt4);
f.f(this.i);
}
public void setMaxCardElevation(float paramFloat)
{
f.b(this.i, paramFloat);
}
public void setMinimumHeight(int paramInt)
{
this.b = paramInt;
super.setMinimumHeight(paramInt);
}
public void setMinimumWidth(int paramInt)
{
this.a = paramInt;
super.setMinimumWidth(paramInt);
}
public void setPadding(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {}
public void setPaddingRelative(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {}
public void setPreventCornerOverlap(boolean paramBoolean)
{
if (paramBoolean != this.h)
{
this.h = paramBoolean;
f.h(this.i);
}
}
public void setRadius(float paramFloat)
{
f.a(this.i, paramFloat);
}
public void setUseCompatPadding(boolean paramBoolean)
{
if (this.g != paramBoolean)
{
this.g = paramBoolean;
f.g(this.i);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/widget/CardView.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/