AppCompatImageHelper.java
2.95 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
package android.support.v7.widget;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build.VERSION;
import android.support.annotation.RestrictTo;
import android.support.v7.appcompat.R.styleable;
import android.support.v7.content.res.AppCompatResources;
import android.util.AttributeSet;
import android.widget.ImageView;
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class AppCompatImageHelper
{
private final ImageView a;
public AppCompatImageHelper(ImageView paramImageView)
{
this.a = paramImageView;
}
final boolean a()
{
Drawable localDrawable = this.a.getBackground();
return (Build.VERSION.SDK_INT < 21) || (!(localDrawable instanceof RippleDrawable));
}
public void loadFromAttributes(AttributeSet paramAttributeSet, int paramInt)
{
Object localObject2 = null;
AttributeSet localAttributeSet = null;
Object localObject1 = localObject2;
try
{
Drawable localDrawable2 = this.a.getDrawable();
Drawable localDrawable1 = localDrawable2;
if (localDrawable2 == null)
{
localObject1 = localObject2;
paramAttributeSet = TintTypedArray.obtainStyledAttributes(this.a.getContext(), paramAttributeSet, R.styleable.AppCompatImageView, paramInt, 0);
localObject1 = paramAttributeSet;
paramInt = paramAttributeSet.getResourceId(R.styleable.AppCompatImageView_srcCompat, -1);
localDrawable1 = localDrawable2;
localAttributeSet = paramAttributeSet;
if (paramInt != -1)
{
localObject1 = paramAttributeSet;
localDrawable2 = AppCompatResources.getDrawable(this.a.getContext(), paramInt);
localDrawable1 = localDrawable2;
localAttributeSet = paramAttributeSet;
if (localDrawable2 != null)
{
localObject1 = paramAttributeSet;
this.a.setImageDrawable(localDrawable2);
localAttributeSet = paramAttributeSet;
localDrawable1 = localDrawable2;
}
}
}
if (localDrawable1 != null)
{
localObject1 = localAttributeSet;
DrawableUtils.a(localDrawable1);
}
if (localAttributeSet != null) {
localAttributeSet.recycle();
}
return;
}
finally
{
if (localObject1 != null) {
((TintTypedArray)localObject1).recycle();
}
}
}
public void setImageResource(int paramInt)
{
if (paramInt != 0)
{
Drawable localDrawable = AppCompatResources.getDrawable(this.a.getContext(), paramInt);
if (localDrawable != null) {
DrawableUtils.a(localDrawable);
}
this.a.setImageDrawable(localDrawable);
return;
}
this.a.setImageDrawable(null);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/widget/AppCompatImageHelper.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/