Loader.java
5.78 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
package android.support.v4.content;
import android.content.Context;
import android.database.ContentObserver;
import android.os.Handler;
import android.support.v4.util.DebugUtils;
import java.io.FileDescriptor;
import java.io.PrintWriter;
public class Loader<D>
{
int n;
OnLoadCompleteListener<D> o;
OnLoadCanceledListener<D> p;
Context q;
boolean r = false;
boolean s = false;
boolean t = true;
boolean u = false;
boolean v = false;
public Loader(Context paramContext)
{
this.q = paramContext.getApplicationContext();
}
public void abandon()
{
this.s = true;
onAbandon();
}
public boolean cancelLoad()
{
return onCancelLoad();
}
public void commitContentChanged()
{
this.v = false;
}
public String dataToString(D paramD)
{
StringBuilder localStringBuilder = new StringBuilder(64);
DebugUtils.buildShortClassTag(paramD, localStringBuilder);
localStringBuilder.append("}");
return localStringBuilder.toString();
}
public void deliverCancellation()
{
if (this.p != null) {
this.p.onLoadCanceled(this);
}
}
public void deliverResult(D paramD)
{
if (this.o != null) {
this.o.onLoadComplete(this, paramD);
}
}
public void dump(String paramString, FileDescriptor paramFileDescriptor, PrintWriter paramPrintWriter, String[] paramArrayOfString)
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mId=");
paramPrintWriter.print(this.n);
paramPrintWriter.print(" mListener=");
paramPrintWriter.println(this.o);
if ((this.r) || (this.u) || (this.v))
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mStarted=");
paramPrintWriter.print(this.r);
paramPrintWriter.print(" mContentChanged=");
paramPrintWriter.print(this.u);
paramPrintWriter.print(" mProcessingChange=");
paramPrintWriter.println(this.v);
}
if ((this.s) || (this.t))
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mAbandoned=");
paramPrintWriter.print(this.s);
paramPrintWriter.print(" mReset=");
paramPrintWriter.println(this.t);
}
}
public void forceLoad()
{
onForceLoad();
}
public Context getContext()
{
return this.q;
}
public int getId()
{
return this.n;
}
public boolean isAbandoned()
{
return this.s;
}
public boolean isReset()
{
return this.t;
}
public boolean isStarted()
{
return this.r;
}
protected void onAbandon() {}
protected boolean onCancelLoad()
{
return false;
}
public void onContentChanged()
{
if (this.r)
{
forceLoad();
return;
}
this.u = true;
}
protected void onForceLoad() {}
protected void onReset() {}
protected void onStartLoading() {}
protected void onStopLoading() {}
public void registerListener(int paramInt, OnLoadCompleteListener<D> paramOnLoadCompleteListener)
{
if (this.o != null) {
throw new IllegalStateException("There is already a listener registered");
}
this.o = paramOnLoadCompleteListener;
this.n = paramInt;
}
public void registerOnLoadCanceledListener(OnLoadCanceledListener<D> paramOnLoadCanceledListener)
{
if (this.p != null) {
throw new IllegalStateException("There is already a listener registered");
}
this.p = paramOnLoadCanceledListener;
}
public void reset()
{
onReset();
this.t = true;
this.r = false;
this.s = false;
this.u = false;
this.v = false;
}
public void rollbackContentChanged()
{
if (this.v) {
onContentChanged();
}
}
public final void startLoading()
{
this.r = true;
this.t = false;
this.s = false;
onStartLoading();
}
public void stopLoading()
{
this.r = false;
onStopLoading();
}
public boolean takeContentChanged()
{
boolean bool = this.u;
this.u = false;
this.v |= bool;
return bool;
}
public String toString()
{
StringBuilder localStringBuilder = new StringBuilder(64);
DebugUtils.buildShortClassTag(this, localStringBuilder);
localStringBuilder.append(" id=");
localStringBuilder.append(this.n);
localStringBuilder.append("}");
return localStringBuilder.toString();
}
public void unregisterListener(OnLoadCompleteListener<D> paramOnLoadCompleteListener)
{
if (this.o == null) {
throw new IllegalStateException("No listener register");
}
if (this.o != paramOnLoadCompleteListener) {
throw new IllegalArgumentException("Attempting to unregister the wrong listener");
}
this.o = null;
}
public void unregisterOnLoadCanceledListener(OnLoadCanceledListener<D> paramOnLoadCanceledListener)
{
if (this.p == null) {
throw new IllegalStateException("No listener register");
}
if (this.p != paramOnLoadCanceledListener) {
throw new IllegalArgumentException("Attempting to unregister the wrong listener");
}
this.p = null;
}
public final class ForceLoadContentObserver
extends ContentObserver
{
public ForceLoadContentObserver()
{
super();
}
public final boolean deliverSelfNotifications()
{
return true;
}
public final void onChange(boolean paramBoolean)
{
Loader.this.onContentChanged();
}
}
public static abstract interface OnLoadCanceledListener<D>
{
public abstract void onLoadCanceled(Loader<D> paramLoader);
}
public static abstract interface OnLoadCompleteListener<D>
{
public abstract void onLoadComplete(Loader<D> paramLoader, D paramD);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/content/Loader.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/