n.java
7.8 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
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.Path.FillType;
import android.graphics.RadialGradient;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader.TileMode;
import android.graphics.drawable.Drawable;
import android.support.design.R.color;
import android.support.v4.content.ContextCompat;
import android.support.v7.graphics.drawable.DrawableWrapper;
final class n
extends DrawableWrapper
{
static final double a = Math.cos(Math.toRadians(45.0D));
final Paint b;
final Paint c;
final RectF d;
float e;
Path f;
float g;
float h;
float i;
float j;
boolean k = true;
float l;
private boolean m = true;
private final int n;
private final int o;
private final int p;
private boolean q = false;
public n(Context paramContext, Drawable paramDrawable, float paramFloat1, float paramFloat2, float paramFloat3)
{
super(paramDrawable);
this.n = ContextCompat.getColor(paramContext, R.color.design_fab_shadow_start_color);
this.o = ContextCompat.getColor(paramContext, R.color.design_fab_shadow_mid_color);
this.p = ContextCompat.getColor(paramContext, R.color.design_fab_shadow_end_color);
this.b = new Paint(5);
this.b.setStyle(Paint.Style.FILL);
this.e = Math.round(paramFloat1);
this.d = new RectF();
this.c = new Paint(this.b);
this.c.setAntiAlias(false);
a(paramFloat2, paramFloat3);
}
public static float a(float paramFloat1, float paramFloat2, boolean paramBoolean)
{
if (paramBoolean) {
return (float)(1.5F * paramFloat1 + (1.0D - a) * paramFloat2);
}
return 1.5F * paramFloat1;
}
public static float b(float paramFloat1, float paramFloat2, boolean paramBoolean)
{
float f1 = paramFloat1;
if (paramBoolean) {
f1 = (float)(paramFloat1 + (1.0D - a) * paramFloat2);
}
return f1;
}
private static int b(float paramFloat)
{
int i2 = Math.round(paramFloat);
int i1 = i2;
if (i2 % 2 == 1) {
i1 = i2 - 1;
}
return i1;
}
public final void a(float paramFloat)
{
a(paramFloat, this.h);
}
final void a(float paramFloat1, float paramFloat2)
{
if ((paramFloat1 < 0.0F) || (paramFloat2 < 0.0F)) {
throw new IllegalArgumentException("invalid shadow size");
}
float f1 = b(paramFloat1);
paramFloat2 = b(paramFloat2);
paramFloat1 = f1;
if (f1 > paramFloat2)
{
if (!this.q) {
this.q = true;
}
paramFloat1 = paramFloat2;
}
if ((this.j == paramFloat1) && (this.h == paramFloat2)) {
return;
}
this.j = paramFloat1;
this.h = paramFloat2;
this.i = Math.round(paramFloat1 * 1.5F);
this.g = paramFloat2;
this.m = true;
invalidateSelf();
}
public final void draw(Canvas paramCanvas)
{
float f1;
float f2;
float f3;
int i1;
int i3;
if (this.m)
{
Object localObject = getBounds();
f1 = this.h * 1.5F;
this.d.set(((Rect)localObject).left + this.h, ((Rect)localObject).top + f1, ((Rect)localObject).right - this.h, ((Rect)localObject).bottom - f1);
getWrappedDrawable().setBounds((int)this.d.left, (int)this.d.top, (int)this.d.right, (int)this.d.bottom);
localObject = new RectF(-this.e, -this.e, this.e, this.e);
RectF localRectF = new RectF((RectF)localObject);
localRectF.inset(-this.i, -this.i);
if (this.f == null)
{
this.f = new Path();
this.f.setFillType(Path.FillType.EVEN_ODD);
this.f.moveTo(-this.e, 0.0F);
this.f.rLineTo(-this.i, 0.0F);
this.f.arcTo(localRectF, 180.0F, 90.0F, false);
this.f.arcTo((RectF)localObject, 270.0F, -90.0F, false);
this.f.close();
f1 = -localRectF.top;
if (f1 > 0.0F)
{
f2 = this.e / f1;
f3 = (1.0F - f2) / 2.0F;
localPaint = this.b;
i1 = this.n;
i2 = this.o;
i3 = this.p;
Shader.TileMode localTileMode = Shader.TileMode.CLAMP;
localPaint.setShader(new RadialGradient(0.0F, 0.0F, f1, new int[] { 0, i1, i2, i3 }, new float[] { 0.0F, f2, f2 + f3, 1.0F }, localTileMode));
}
Paint localPaint = this.c;
f1 = ((RectF)localObject).top;
f2 = localRectF.top;
i1 = this.n;
i2 = this.o;
i3 = this.p;
localObject = Shader.TileMode.CLAMP;
localPaint.setShader(new LinearGradient(0.0F, f1, 0.0F, f2, new int[] { i1, i2, i3 }, new float[] { 0.0F, 0.5F, 1.0F }, (Shader.TileMode)localObject));
this.c.setAntiAlias(false);
this.m = false;
}
}
else
{
i3 = paramCanvas.save();
paramCanvas.rotate(this.l, this.d.centerX(), this.d.centerY());
f1 = -this.e - this.i;
f2 = this.e;
if (this.d.width() - 2.0F * f2 <= 0.0F) {
break label1061;
}
i1 = 1;
label535:
if (this.d.height() - 2.0F * f2 <= 0.0F) {
break label1067;
}
}
label1061:
label1067:
for (int i2 = 1;; i2 = 0)
{
float f6 = this.j;
float f7 = this.j;
f3 = this.j;
float f8 = this.j;
float f4 = this.j;
float f5 = this.j;
f3 = f2 / (f3 - f8 * 0.5F + f2);
f6 = f2 / (f6 - f7 * 0.25F + f2);
f4 = f2 / (f2 + (f4 - f5 * 1.0F));
int i4 = paramCanvas.save();
paramCanvas.translate(this.d.left + f2, this.d.top + f2);
paramCanvas.scale(f3, f6);
paramCanvas.drawPath(this.f, this.b);
if (i1 != 0)
{
paramCanvas.scale(1.0F / f3, 1.0F);
paramCanvas.drawRect(0.0F, f1, this.d.width() - 2.0F * f2, -this.e, this.c);
}
paramCanvas.restoreToCount(i4);
i4 = paramCanvas.save();
paramCanvas.translate(this.d.right - f2, this.d.bottom - f2);
paramCanvas.scale(f3, f4);
paramCanvas.rotate(180.0F);
paramCanvas.drawPath(this.f, this.b);
if (i1 != 0)
{
paramCanvas.scale(1.0F / f3, 1.0F);
f5 = this.d.width();
f7 = -this.e;
paramCanvas.drawRect(0.0F, f1, f5 - 2.0F * f2, this.i + f7, this.c);
}
paramCanvas.restoreToCount(i4);
i1 = paramCanvas.save();
paramCanvas.translate(this.d.left + f2, this.d.bottom - f2);
paramCanvas.scale(f3, f4);
paramCanvas.rotate(270.0F);
paramCanvas.drawPath(this.f, this.b);
if (i2 != 0)
{
paramCanvas.scale(1.0F / f4, 1.0F);
paramCanvas.drawRect(0.0F, f1, this.d.height() - 2.0F * f2, -this.e, this.c);
}
paramCanvas.restoreToCount(i1);
i1 = paramCanvas.save();
paramCanvas.translate(this.d.right - f2, this.d.top + f2);
paramCanvas.scale(f3, f6);
paramCanvas.rotate(90.0F);
paramCanvas.drawPath(this.f, this.b);
if (i2 != 0)
{
paramCanvas.scale(1.0F / f6, 1.0F);
paramCanvas.drawRect(0.0F, f1, this.d.height() - 2.0F * f2, -this.e, this.c);
}
paramCanvas.restoreToCount(i1);
paramCanvas.restoreToCount(i3);
super.draw(paramCanvas);
return;
this.f.reset();
break;
i1 = 0;
break label535;
}
}
public final int getOpacity()
{
return -3;
}
public final boolean getPadding(Rect paramRect)
{
int i1 = (int)Math.ceil(a(this.h, this.e, this.k));
int i2 = (int)Math.ceil(b(this.h, this.e, this.k));
paramRect.set(i2, i1, i2, i1);
return true;
}
protected final void onBoundsChange(Rect paramRect)
{
this.m = true;
}
public final void setAlpha(int paramInt)
{
super.setAlpha(paramInt);
this.b.setAlpha(paramInt);
this.c.setAlpha(paramInt);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/n.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/