AsyncLayoutInflater.java
6.77 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
package android.support.v4.view;
import android.content.Context;
import android.os.Handler;
import android.os.Handler.Callback;
import android.os.Message;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.UiThread;
import android.support.v4.util.Pools.SynchronizedPool;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.concurrent.ArrayBlockingQueue;
public final class AsyncLayoutInflater
{
LayoutInflater a;
Handler b;
c c;
private Handler.Callback d = new Handler.Callback()
{
public final boolean handleMessage(Message paramAnonymousMessage)
{
paramAnonymousMessage = (AsyncLayoutInflater.b)paramAnonymousMessage.obj;
if (paramAnonymousMessage.d == null) {
paramAnonymousMessage.d = AsyncLayoutInflater.this.a.inflate(paramAnonymousMessage.c, paramAnonymousMessage.b, false);
}
paramAnonymousMessage.e.onInflateFinished(paramAnonymousMessage.d, paramAnonymousMessage.c, paramAnonymousMessage.b);
AsyncLayoutInflater.c localc = AsyncLayoutInflater.this.c;
paramAnonymousMessage.e = null;
paramAnonymousMessage.a = null;
paramAnonymousMessage.b = null;
paramAnonymousMessage.c = 0;
paramAnonymousMessage.d = null;
localc.b.release(paramAnonymousMessage);
return true;
}
};
public AsyncLayoutInflater(@NonNull Context paramContext)
{
this.a = new a(paramContext);
this.b = new Handler(this.d);
this.c = c.a();
}
@UiThread
public final void inflate(@LayoutRes int paramInt, @Nullable ViewGroup paramViewGroup, @NonNull OnInflateFinishedListener paramOnInflateFinishedListener)
{
if (paramOnInflateFinishedListener == null) {
throw new NullPointerException("callback argument may not be null!");
}
b localb2 = (b)this.c.b.acquire();
b localb1 = localb2;
if (localb2 == null) {
localb1 = new b();
}
localb1.a = this;
localb1.c = paramInt;
localb1.b = paramViewGroup;
localb1.e = paramOnInflateFinishedListener;
paramViewGroup = this.c;
try
{
paramViewGroup.a.put(localb1);
return;
}
catch (InterruptedException paramViewGroup)
{
throw new RuntimeException("Failed to enqueue async inflate request", paramViewGroup);
}
}
public static abstract interface OnInflateFinishedListener
{
public abstract void onInflateFinished(View paramView, int paramInt, ViewGroup paramViewGroup);
}
static final class a
extends LayoutInflater
{
private static final String[] a = { "android.widget.", "android.webkit.", "android.app." };
a(Context paramContext)
{
super();
}
public final LayoutInflater cloneInContext(Context paramContext)
{
return new a(paramContext);
}
protected final View onCreateView(String paramString, AttributeSet paramAttributeSet)
throws ClassNotFoundException
{
String[] arrayOfString = a;
int j = arrayOfString.length;
int i = 0;
while (i < j)
{
Object localObject = arrayOfString[i];
try
{
localObject = createView(paramString, (String)localObject, paramAttributeSet);
if (localObject != null) {
return (View)localObject;
}
}
catch (ClassNotFoundException localClassNotFoundException)
{
i += 1;
}
}
return super.onCreateView(paramString, paramAttributeSet);
}
}
static final class b
{
AsyncLayoutInflater a;
ViewGroup b;
int c;
View d;
AsyncLayoutInflater.OnInflateFinishedListener e;
}
static final class c
extends Thread
{
private static final c c;
ArrayBlockingQueue<AsyncLayoutInflater.b> a = new ArrayBlockingQueue(10);
Pools.SynchronizedPool<AsyncLayoutInflater.b> b = new Pools.SynchronizedPool(10);
static
{
c localc = new c();
c = localc;
localc.start();
}
public static c a()
{
return c;
}
/* Error */
public final void run()
{
// Byte code:
// 0: aload_0
// 1: getfield 33 android/support/v4/view/AsyncLayoutInflater$c:a Ljava/util/concurrent/ArrayBlockingQueue;
// 4: invokevirtual 48 java/util/concurrent/ArrayBlockingQueue:take ()Ljava/lang/Object;
// 7: checkcast 50 android/support/v4/view/AsyncLayoutInflater$b
// 10: astore_1
// 11: aload_1
// 12: aload_1
// 13: getfield 53 android/support/v4/view/AsyncLayoutInflater$b:a Landroid/support/v4/view/AsyncLayoutInflater;
// 16: getfield 56 android/support/v4/view/AsyncLayoutInflater:a Landroid/view/LayoutInflater;
// 19: aload_1
// 20: getfield 59 android/support/v4/view/AsyncLayoutInflater$b:c I
// 23: aload_1
// 24: getfield 62 android/support/v4/view/AsyncLayoutInflater$b:b Landroid/view/ViewGroup;
// 27: iconst_0
// 28: invokevirtual 68 android/view/LayoutInflater:inflate (ILandroid/view/ViewGroup;Z)Landroid/view/View;
// 31: putfield 72 android/support/v4/view/AsyncLayoutInflater$b:d Landroid/view/View;
// 34: aload_1
// 35: getfield 53 android/support/v4/view/AsyncLayoutInflater$b:a Landroid/support/v4/view/AsyncLayoutInflater;
// 38: getfield 75 android/support/v4/view/AsyncLayoutInflater:b Landroid/os/Handler;
// 41: iconst_0
// 42: aload_1
// 43: invokestatic 81 android/os/Message:obtain (Landroid/os/Handler;ILjava/lang/Object;)Landroid/os/Message;
// 46: invokevirtual 84 android/os/Message:sendToTarget ()V
// 49: goto -49 -> 0
// 52: astore_1
// 53: ldc 86
// 55: aload_1
// 56: invokestatic 92 android/util/Log:w (Ljava/lang/String;Ljava/lang/Throwable;)I
// 59: pop
// 60: goto -60 -> 0
// 63: astore_2
// 64: ldc 86
// 66: ldc 94
// 68: aload_2
// 69: invokestatic 97 android/util/Log:w (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
// 72: pop
// 73: goto -39 -> 34
// Local variable table:
// start length slot name signature
// 0 76 0 this c
// 10 33 1 localb AsyncLayoutInflater.b
// 52 4 1 localInterruptedException InterruptedException
// 63 6 2 localRuntimeException RuntimeException
// Exception table:
// from to target type
// 0 11 52 java/lang/InterruptedException
// 11 34 63 java/lang/RuntimeException
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/view/AsyncLayoutInflater.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/