ContextThemeWrapper.java
2.36 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
package android.support.v7.view;
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.support.annotation.RestrictTo;
import android.support.annotation.StyleRes;
import android.support.v7.appcompat.R.style;
import android.view.LayoutInflater;
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class ContextThemeWrapper
extends ContextWrapper
{
private int a;
private Resources.Theme b;
private LayoutInflater c;
public ContextThemeWrapper(Context paramContext, @StyleRes int paramInt)
{
super(paramContext);
this.a = paramInt;
}
public ContextThemeWrapper(Context paramContext, Resources.Theme paramTheme)
{
super(paramContext);
this.b = paramTheme;
}
private void a()
{
if (this.b == null) {}
for (boolean bool = true;; bool = false)
{
if (bool)
{
this.b = getResources().newTheme();
Resources.Theme localTheme = getBaseContext().getTheme();
if (localTheme != null) {
this.b.setTo(localTheme);
}
}
onApplyThemeResource(this.b, this.a, bool);
return;
}
}
public AssetManager getAssets()
{
return getResources().getAssets();
}
public Object getSystemService(String paramString)
{
if ("layout_inflater".equals(paramString))
{
if (this.c == null) {
this.c = LayoutInflater.from(getBaseContext()).cloneInContext(this);
}
return this.c;
}
return getBaseContext().getSystemService(paramString);
}
public Resources.Theme getTheme()
{
if (this.b != null) {
return this.b;
}
if (this.a == 0) {
this.a = R.style.Theme_AppCompat_Light;
}
a();
return this.b;
}
public int getThemeResId()
{
return this.a;
}
protected void onApplyThemeResource(Resources.Theme paramTheme, int paramInt, boolean paramBoolean)
{
paramTheme.applyStyle(paramInt, true);
}
public void setTheme(int paramInt)
{
if (this.a != paramInt)
{
this.a = paramInt;
a();
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v7/view/ContextThemeWrapper.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/