PagerTabStrip.java
6.32 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
package android.support.v4.view;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewConfiguration;
import android.widget.TextView;
public class PagerTabStrip
extends PagerTitleStrip
{
private int g = this.f;
private int h;
private int i;
private int j;
private int k;
private int l;
private final Paint m = new Paint();
private final Rect n = new Rect();
private int o = 255;
private boolean p = false;
private boolean q = false;
private int r;
private boolean s;
private float t;
private float u;
private int v;
public PagerTabStrip(Context paramContext)
{
this(paramContext, null);
}
public PagerTabStrip(Context paramContext, AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
this.m.setColor(this.g);
float f = paramContext.getResources().getDisplayMetrics().density;
this.h = ((int)(3.0F * f + 0.5F));
this.i = ((int)(6.0F * f + 0.5F));
this.j = ((int)(64.0F * f));
this.l = ((int)(16.0F * f + 0.5F));
this.r = ((int)(1.0F * f + 0.5F));
this.k = ((int)(f * 32.0F + 0.5F));
this.v = ViewConfiguration.get(paramContext).getScaledTouchSlop();
setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), getPaddingBottom());
setTextSpacing(getTextSpacing());
setWillNotDraw(false);
this.b.setFocusable(true);
this.b.setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
PagerTabStrip.this.a.setCurrentItem(PagerTabStrip.this.a.getCurrentItem() - 1);
}
});
this.d.setFocusable(true);
this.d.setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
PagerTabStrip.this.a.setCurrentItem(PagerTabStrip.this.a.getCurrentItem() + 1);
}
});
if (getBackground() == null) {
this.p = true;
}
}
final void a(int paramInt, float paramFloat, boolean paramBoolean)
{
Rect localRect = this.n;
int i1 = getHeight();
int i2 = this.c.getLeft();
int i3 = this.l;
int i4 = this.c.getRight();
int i5 = this.l;
int i6 = i1 - this.h;
localRect.set(i2 - i3, i6, i4 + i5, i1);
super.a(paramInt, paramFloat, paramBoolean);
this.o = ((int)(Math.abs(paramFloat - 0.5F) * 2.0F * 255.0F));
localRect.union(this.c.getLeft() - this.l, i6, this.c.getRight() + this.l, i1);
invalidate(localRect);
}
public boolean getDrawFullUnderline()
{
return this.p;
}
int getMinHeight()
{
return Math.max(super.getMinHeight(), this.k);
}
@ColorInt
public int getTabIndicatorColor()
{
return this.g;
}
protected void onDraw(Canvas paramCanvas)
{
super.onDraw(paramCanvas);
int i1 = getHeight();
int i2 = this.c.getLeft();
int i3 = this.l;
int i4 = this.c.getRight();
int i5 = this.l;
int i6 = this.h;
this.m.setColor(this.o << 24 | this.g & 0xFFFFFF);
paramCanvas.drawRect(i2 - i3, i1 - i6, i4 + i5, i1, this.m);
if (this.p)
{
this.m.setColor(0xFF000000 | this.g & 0xFFFFFF);
paramCanvas.drawRect(getPaddingLeft(), i1 - this.r, getWidth() - getPaddingRight(), i1, this.m);
}
}
public boolean onTouchEvent(MotionEvent paramMotionEvent)
{
int i1 = paramMotionEvent.getAction();
if ((i1 != 0) && (this.s)) {
return false;
}
float f1 = paramMotionEvent.getX();
float f2 = paramMotionEvent.getY();
switch (i1)
{
}
for (;;)
{
return true;
this.t = f1;
this.u = f2;
this.s = false;
continue;
if ((Math.abs(f1 - this.t) > this.v) || (Math.abs(f2 - this.u) > this.v))
{
this.s = true;
continue;
if (f1 < this.c.getLeft() - this.l) {
this.a.setCurrentItem(this.a.getCurrentItem() - 1);
} else if (f1 > this.c.getRight() + this.l) {
this.a.setCurrentItem(this.a.getCurrentItem() + 1);
}
}
}
}
public void setBackgroundColor(@ColorInt int paramInt)
{
super.setBackgroundColor(paramInt);
if (!this.q) {
if ((0xFF000000 & paramInt) != 0) {
break label27;
}
}
label27:
for (boolean bool = true;; bool = false)
{
this.p = bool;
return;
}
}
public void setBackgroundDrawable(Drawable paramDrawable)
{
super.setBackgroundDrawable(paramDrawable);
if (!this.q) {
if (paramDrawable != null) {
break label24;
}
}
label24:
for (boolean bool = true;; bool = false)
{
this.p = bool;
return;
}
}
public void setBackgroundResource(@DrawableRes int paramInt)
{
super.setBackgroundResource(paramInt);
if (!this.q) {
if (paramInt != 0) {
break label24;
}
}
label24:
for (boolean bool = true;; bool = false)
{
this.p = bool;
return;
}
}
public void setDrawFullUnderline(boolean paramBoolean)
{
this.p = paramBoolean;
this.q = true;
invalidate();
}
public void setPadding(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
int i1 = paramInt4;
if (paramInt4 < this.i) {
i1 = this.i;
}
super.setPadding(paramInt1, paramInt2, paramInt3, i1);
}
public void setTabIndicatorColor(@ColorInt int paramInt)
{
this.g = paramInt;
this.m.setColor(this.g);
invalidate();
}
public void setTabIndicatorColorResource(@ColorRes int paramInt)
{
setTabIndicatorColor(ContextCompat.getColor(getContext(), paramInt));
}
public void setTextSpacing(int paramInt)
{
int i1 = paramInt;
if (paramInt < this.j) {
i1 = this.j;
}
super.setTextSpacing(i1);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/view/PagerTabStrip.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/