TintContextWrapper.java
3.55 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
package android.support.v7.widget;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.os.Build.VERSION;
import android.support.annotation.NonNull;
import android.support.annotation.RestrictTo;
import hb;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class TintContextWrapper
extends ContextWrapper
{
private static final Object a = new Object();
private static ArrayList<WeakReference<TintContextWrapper>> b;
private final Resources c;
private final Resources.Theme d;
private TintContextWrapper(@NonNull Context paramContext)
{
super(paramContext);
if (VectorEnabledTintResources.shouldBeUsed())
{
this.c = new VectorEnabledTintResources(this, paramContext.getResources());
this.d = this.c.newTheme();
this.d.setTo(paramContext.getTheme());
return;
}
this.c = new hb(this, paramContext.getResources());
this.d = null;
}
public static Context wrap(@NonNull Context paramContext)
{
int j = 0;
int i = j;
if (!(paramContext instanceof TintContextWrapper))
{
i = j;
if (!(paramContext.getResources() instanceof hb))
{
if (!(paramContext.getResources() instanceof VectorEnabledTintResources)) {
break label94;
}
i = j;
}
}
Object localObject1 = paramContext;
if (i != 0) {}
for (;;)
{
synchronized (a)
{
if (b == null)
{
b = new ArrayList();
localObject1 = new TintContextWrapper(paramContext);
b.add(new WeakReference(localObject1));
return (Context)localObject1;
label94:
if (Build.VERSION.SDK_INT >= 21)
{
i = j;
if (!VectorEnabledTintResources.shouldBeUsed()) {
break;
}
}
i = 1;
break;
}
i = b.size() - 1;
if (i >= 0)
{
localObject1 = (WeakReference)b.get(i);
if ((localObject1 == null) || (((WeakReference)localObject1).get() == null)) {
b.remove(i);
}
}
else
{
i = b.size() - 1;
if (i < 0) {
continue;
}
localObject1 = (WeakReference)b.get(i);
if (localObject1 == null) {
break label227;
}
localObject1 = (TintContextWrapper)((WeakReference)localObject1).get();
if ((localObject1 == null) || (((TintContextWrapper)localObject1).getBaseContext() != paramContext)) {
break label232;
}
return (Context)localObject1;
}
}
i -= 1;
continue;
label227:
localObject1 = null;
continue;
label232:
i -= 1;
}
}
public AssetManager getAssets()
{
return this.c.getAssets();
}
public Resources getResources()
{
return this.c;
}
public Resources.Theme getTheme()
{
if (this.d == null) {
return super.getTheme();
}
return this.d;
}
public void setTheme(int paramInt)
{
if (this.d == null)
{
super.setTheme(paramInt);
return;
}
this.d.applyStyle(paramInt, true);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/widget/TintContextWrapper.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/