ge.java
3.37 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
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.PorterDuff.Mode;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.support.annotation.Nullable;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.widget.CompoundButtonCompat;
import android.support.v7.appcompat.R.styleable;
import android.support.v7.content.res.AppCompatResources;
import android.support.v7.widget.DrawableUtils;
import android.util.AttributeSet;
import android.widget.CompoundButton;
public final class ge
{
public ColorStateList a = null;
public PorterDuff.Mode b = null;
private final CompoundButton c;
private boolean d = false;
private boolean e = false;
private boolean f;
public ge(CompoundButton paramCompoundButton)
{
this.c = paramCompoundButton;
}
private void b()
{
Drawable localDrawable = CompoundButtonCompat.getButtonDrawable(this.c);
if ((localDrawable != null) && ((this.d) || (this.e)))
{
localDrawable = DrawableCompat.wrap(localDrawable).mutate();
if (this.d) {
DrawableCompat.setTintList(localDrawable, this.a);
}
if (this.e) {
DrawableCompat.setTintMode(localDrawable, this.b);
}
if (localDrawable.isStateful()) {
localDrawable.setState(this.c.getDrawableState());
}
this.c.setButtonDrawable(localDrawable);
}
}
public final int a(int paramInt)
{
int i = paramInt;
if (Build.VERSION.SDK_INT < 17)
{
Drawable localDrawable = CompoundButtonCompat.getButtonDrawable(this.c);
i = paramInt;
if (localDrawable != null) {
i = paramInt + localDrawable.getIntrinsicWidth();
}
}
return i;
}
public final void a()
{
if (this.f)
{
this.f = false;
return;
}
this.f = true;
b();
}
public final void a(ColorStateList paramColorStateList)
{
this.a = paramColorStateList;
this.d = true;
b();
}
public final void a(@Nullable PorterDuff.Mode paramMode)
{
this.b = paramMode;
this.e = true;
b();
}
public final void a(AttributeSet paramAttributeSet, int paramInt)
{
paramAttributeSet = this.c.getContext().obtainStyledAttributes(paramAttributeSet, R.styleable.CompoundButton, paramInt, 0);
try
{
if (paramAttributeSet.hasValue(R.styleable.CompoundButton_android_button))
{
paramInt = paramAttributeSet.getResourceId(R.styleable.CompoundButton_android_button, 0);
if (paramInt != 0) {
this.c.setButtonDrawable(AppCompatResources.getDrawable(this.c.getContext(), paramInt));
}
}
if (paramAttributeSet.hasValue(R.styleable.CompoundButton_buttonTint)) {
CompoundButtonCompat.setButtonTintList(this.c, paramAttributeSet.getColorStateList(R.styleable.CompoundButton_buttonTint));
}
if (paramAttributeSet.hasValue(R.styleable.CompoundButton_buttonTintMode)) {
CompoundButtonCompat.setButtonTintMode(this.c, DrawableUtils.a(paramAttributeSet.getInt(R.styleable.CompoundButton_buttonTintMode, -1), null));
}
return;
}
finally
{
paramAttributeSet.recycle();
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/ge.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/