DrawerArrowDrawable.java
8.01 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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
package android.support.v7.graphics.drawable;
import android.content.Context;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Paint.Cap;
import android.graphics.Paint.Join;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.FloatRange;
import android.support.annotation.RestrictTo;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.appcompat.R.attr;
import android.support.v7.appcompat.R.style;
import android.support.v7.appcompat.R.styleable;
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
public class DrawerArrowDrawable
extends Drawable
{
public static final int ARROW_DIRECTION_END = 3;
public static final int ARROW_DIRECTION_LEFT = 0;
public static final int ARROW_DIRECTION_RIGHT = 1;
public static final int ARROW_DIRECTION_START = 2;
private static final float b = (float)Math.toRadians(45.0D);
private final Paint a = new Paint();
private float c;
private float d;
private float e;
private float f;
private boolean g;
private final Path h = new Path();
private final int i;
private boolean j = false;
private float k;
private float l;
private int m = 2;
public DrawerArrowDrawable(Context paramContext)
{
this.a.setStyle(Paint.Style.STROKE);
this.a.setStrokeJoin(Paint.Join.MITER);
this.a.setStrokeCap(Paint.Cap.BUTT);
this.a.setAntiAlias(true);
paramContext = paramContext.getTheme().obtainStyledAttributes(null, R.styleable.DrawerArrowToggle, R.attr.drawerArrowStyle, R.style.Base_Widget_AppCompat_DrawerArrowToggle);
setColor(paramContext.getColor(R.styleable.DrawerArrowToggle_color, 0));
setBarThickness(paramContext.getDimension(R.styleable.DrawerArrowToggle_thickness, 0.0F));
setSpinEnabled(paramContext.getBoolean(R.styleable.DrawerArrowToggle_spinBars, true));
setGapSize(Math.round(paramContext.getDimension(R.styleable.DrawerArrowToggle_gapBetweenBars, 0.0F)));
this.i = paramContext.getDimensionPixelSize(R.styleable.DrawerArrowToggle_drawableSize, 0);
this.d = Math.round(paramContext.getDimension(R.styleable.DrawerArrowToggle_barLength, 0.0F));
this.c = Math.round(paramContext.getDimension(R.styleable.DrawerArrowToggle_arrowHeadLength, 0.0F));
this.e = paramContext.getDimension(R.styleable.DrawerArrowToggle_arrowShaftLength, 0.0F);
paramContext.recycle();
}
public void draw(Canvas paramCanvas)
{
Rect localRect = getBounds();
int n;
float f1;
float f2;
switch (this.m)
{
case 2:
default:
if (DrawableCompat.getLayoutDirection(this) == 1)
{
n = 1;
f1 = (float)Math.sqrt(this.c * this.c * 2.0F);
f2 = this.d;
float f6 = f2 + (f1 - f2) * this.k;
f1 = this.d;
float f3 = f1 + (this.e - f1) * this.k;
float f4 = Math.round(0.0F + (this.l - 0.0F) * this.k);
float f7 = 0.0F + (b - 0.0F) * this.k;
if (n == 0) {
break label478;
}
f1 = 0.0F;
label145:
if (n == 0) {
break label485;
}
f2 = 180.0F;
label153:
float f5 = this.k;
float f8 = (float)Math.round(f6 * Math.cos(f7));
f6 = (float)Math.round(f6 * Math.sin(f7));
this.h.rewind();
f7 = this.f + this.a.getStrokeWidth();
f7 += (-this.l - f7) * this.k;
float f9 = -f3 / 2.0F;
this.h.moveTo(f9 + f4, 0.0F);
this.h.rLineTo(f3 - f4 * 2.0F, 0.0F);
this.h.moveTo(f9, f7);
this.h.rLineTo(f8, f6);
this.h.moveTo(f9, -f7);
this.h.rLineTo(f8, -f6);
this.h.close();
paramCanvas.save();
f3 = this.a.getStrokeWidth();
f3 = (float)((int)(localRect.height() - 3.0F * f3 - this.f * 2.0F) / 4 * 2 + (f3 * 1.5D + this.f));
paramCanvas.translate(localRect.centerX(), f3);
if (!this.g) {
break label496;
}
if ((n ^ this.j) == 0) {
break label490;
}
n = -1;
label408:
paramCanvas.rotate(n * ((f2 - f1) * f5 + f1));
}
break;
}
for (;;)
{
paramCanvas.drawPath(this.h, this.a);
paramCanvas.restore();
return;
n = 0;
break;
n = 1;
break;
if (DrawableCompat.getLayoutDirection(this) == 0)
{
n = 1;
break;
}
n = 0;
break;
n = 0;
break;
label478:
f1 = -180.0F;
break label145;
label485:
f2 = 0.0F;
break label153;
label490:
n = 1;
break label408;
label496:
if (n != 0) {
paramCanvas.rotate(180.0F);
}
}
}
public float getArrowHeadLength()
{
return this.c;
}
public float getArrowShaftLength()
{
return this.e;
}
public float getBarLength()
{
return this.d;
}
public float getBarThickness()
{
return this.a.getStrokeWidth();
}
@ColorInt
public int getColor()
{
return this.a.getColor();
}
public int getDirection()
{
return this.m;
}
public float getGapSize()
{
return this.f;
}
public int getIntrinsicHeight()
{
return this.i;
}
public int getIntrinsicWidth()
{
return this.i;
}
public int getOpacity()
{
return -3;
}
public final Paint getPaint()
{
return this.a;
}
@FloatRange(from=0.0D, to=1.0D)
public float getProgress()
{
return this.k;
}
public boolean isSpinEnabled()
{
return this.g;
}
public void setAlpha(int paramInt)
{
if (paramInt != this.a.getAlpha())
{
this.a.setAlpha(paramInt);
invalidateSelf();
}
}
public void setArrowHeadLength(float paramFloat)
{
if (this.c != paramFloat)
{
this.c = paramFloat;
invalidateSelf();
}
}
public void setArrowShaftLength(float paramFloat)
{
if (this.e != paramFloat)
{
this.e = paramFloat;
invalidateSelf();
}
}
public void setBarLength(float paramFloat)
{
if (this.d != paramFloat)
{
this.d = paramFloat;
invalidateSelf();
}
}
public void setBarThickness(float paramFloat)
{
if (this.a.getStrokeWidth() != paramFloat)
{
this.a.setStrokeWidth(paramFloat);
this.l = ((float)(paramFloat / 2.0F * Math.cos(b)));
invalidateSelf();
}
}
public void setColor(@ColorInt int paramInt)
{
if (paramInt != this.a.getColor())
{
this.a.setColor(paramInt);
invalidateSelf();
}
}
public void setColorFilter(ColorFilter paramColorFilter)
{
this.a.setColorFilter(paramColorFilter);
invalidateSelf();
}
public void setDirection(int paramInt)
{
if (paramInt != this.m)
{
this.m = paramInt;
invalidateSelf();
}
}
public void setGapSize(float paramFloat)
{
if (paramFloat != this.f)
{
this.f = paramFloat;
invalidateSelf();
}
}
public void setProgress(@FloatRange(from=0.0D, to=1.0D) float paramFloat)
{
if (this.k != paramFloat)
{
this.k = paramFloat;
invalidateSelf();
}
}
public void setSpinEnabled(boolean paramBoolean)
{
if (this.g != paramBoolean)
{
this.g = paramBoolean;
invalidateSelf();
}
}
public void setVerticalMirror(boolean paramBoolean)
{
if (this.j != paramBoolean)
{
this.j = paramBoolean;
invalidateSelf();
}
}
@Retention(RetentionPolicy.SOURCE)
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public static @interface ArrowDirection {}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/graphics/drawable/DrawerArrowDrawable.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/