Request.java
10.5 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
package com.squareup.picasso;
import android.graphics.Bitmap.Config;
import android.net.Uri;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
public final class Request
{
private static final long d = TimeUnit.SECONDS.toNanos(5L);
int a;
long b;
public int c;
public final boolean centerCrop;
public final boolean centerInside;
public final Bitmap.Config config;
public final boolean hasRotationPivot;
public final boolean onlyScaleDown;
public final Picasso.Priority priority;
public final int resourceId;
public final float rotationDegrees;
public final float rotationPivotX;
public final float rotationPivotY;
public final String stableKey;
public final int targetHeight;
public final int targetWidth;
public final List<Transformation> transformations;
public final Uri uri;
private Request(Uri paramUri, int paramInt1, String paramString, List<Transformation> paramList, int paramInt2, int paramInt3, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, float paramFloat1, float paramFloat2, float paramFloat3, boolean paramBoolean4, Bitmap.Config paramConfig, Picasso.Priority paramPriority)
{
this.uri = paramUri;
this.resourceId = paramInt1;
this.stableKey = paramString;
if (paramList == null) {}
for (this.transformations = null;; this.transformations = Collections.unmodifiableList(paramList))
{
this.targetWidth = paramInt2;
this.targetHeight = paramInt3;
this.centerCrop = paramBoolean1;
this.centerInside = paramBoolean2;
this.onlyScaleDown = paramBoolean3;
this.rotationDegrees = paramFloat1;
this.rotationPivotX = paramFloat2;
this.rotationPivotY = paramFloat3;
this.hasRotationPivot = paramBoolean4;
this.config = paramConfig;
this.priority = paramPriority;
return;
}
}
public final String a()
{
long l = System.nanoTime() - this.b;
if (l > d) {
return b() + '+' + TimeUnit.NANOSECONDS.toSeconds(l) + 's';
}
return b() + '+' + TimeUnit.NANOSECONDS.toMillis(l) + "ms";
}
final String b()
{
return "[R" + this.a + ']';
}
public final Builder buildUpon()
{
return new Builder(this, (byte)0);
}
public final boolean c()
{
return (hasSize()) || (this.rotationDegrees != 0.0F);
}
public final boolean d()
{
return this.transformations != null;
}
public final boolean hasSize()
{
return (this.targetWidth != 0) || (this.targetHeight != 0);
}
public final String toString()
{
StringBuilder localStringBuilder = new StringBuilder("Request{");
if (this.resourceId > 0) {
localStringBuilder.append(this.resourceId);
}
while ((this.transformations != null) && (!this.transformations.isEmpty()))
{
Iterator localIterator = this.transformations.iterator();
while (localIterator.hasNext())
{
Transformation localTransformation = (Transformation)localIterator.next();
localStringBuilder.append(' ').append(localTransformation.key());
}
localStringBuilder.append(this.uri);
}
if (this.stableKey != null) {
localStringBuilder.append(" stableKey(").append(this.stableKey).append(')');
}
if (this.targetWidth > 0) {
localStringBuilder.append(" resize(").append(this.targetWidth).append(',').append(this.targetHeight).append(')');
}
if (this.centerCrop) {
localStringBuilder.append(" centerCrop");
}
if (this.centerInside) {
localStringBuilder.append(" centerInside");
}
if (this.rotationDegrees != 0.0F)
{
localStringBuilder.append(" rotation(").append(this.rotationDegrees);
if (this.hasRotationPivot) {
localStringBuilder.append(" @ ").append(this.rotationPivotX).append(',').append(this.rotationPivotY);
}
localStringBuilder.append(')');
}
if (this.config != null) {
localStringBuilder.append(' ').append(this.config);
}
localStringBuilder.append('}');
return localStringBuilder.toString();
}
public static final class Builder
{
int a;
int b;
Picasso.Priority c;
private Uri d;
private int e;
private String f;
private boolean g;
private boolean h;
private boolean i;
private float j;
private float k;
private float l;
private boolean m;
private List<Transformation> n;
private Bitmap.Config o;
public Builder(int paramInt)
{
setResourceId(paramInt);
}
public Builder(Uri paramUri)
{
setUri(paramUri);
}
Builder(Uri paramUri, int paramInt, Bitmap.Config paramConfig)
{
this.d = paramUri;
this.e = paramInt;
this.o = paramConfig;
}
private Builder(Request paramRequest)
{
this.d = paramRequest.uri;
this.e = paramRequest.resourceId;
this.f = paramRequest.stableKey;
this.a = paramRequest.targetWidth;
this.b = paramRequest.targetHeight;
this.g = paramRequest.centerCrop;
this.h = paramRequest.centerInside;
this.j = paramRequest.rotationDegrees;
this.k = paramRequest.rotationPivotX;
this.l = paramRequest.rotationPivotY;
this.m = paramRequest.hasRotationPivot;
this.i = paramRequest.onlyScaleDown;
if (paramRequest.transformations != null) {
this.n = new ArrayList(paramRequest.transformations);
}
this.o = paramRequest.config;
this.c = paramRequest.priority;
}
final boolean a()
{
return (this.d != null) || (this.e != 0);
}
public final Request build()
{
if ((this.h) && (this.g)) {
throw new IllegalStateException("Center crop and center inside can not be used together.");
}
if ((this.g) && (this.a == 0) && (this.b == 0)) {
throw new IllegalStateException("Center crop requires calling resize with positive width and height.");
}
if ((this.h) && (this.a == 0) && (this.b == 0)) {
throw new IllegalStateException("Center inside requires calling resize with positive width and height.");
}
if (this.c == null) {
this.c = Picasso.Priority.NORMAL;
}
return new Request(this.d, this.e, this.f, this.n, this.a, this.b, this.g, this.h, this.i, this.j, this.k, this.l, this.m, this.o, this.c, (byte)0);
}
public final Builder centerCrop()
{
if (this.h) {
throw new IllegalStateException("Center crop can not be used after calling centerInside");
}
this.g = true;
return this;
}
public final Builder centerInside()
{
if (this.g) {
throw new IllegalStateException("Center inside can not be used after calling centerCrop");
}
this.h = true;
return this;
}
public final Builder clearCenterCrop()
{
this.g = false;
return this;
}
public final Builder clearCenterInside()
{
this.h = false;
return this;
}
public final Builder clearOnlyScaleDown()
{
this.i = false;
return this;
}
public final Builder clearResize()
{
this.a = 0;
this.b = 0;
this.g = false;
this.h = false;
return this;
}
public final Builder clearRotation()
{
this.j = 0.0F;
this.k = 0.0F;
this.l = 0.0F;
this.m = false;
return this;
}
public final Builder config(Bitmap.Config paramConfig)
{
this.o = paramConfig;
return this;
}
public final Builder onlyScaleDown()
{
if ((this.b == 0) && (this.a == 0)) {
throw new IllegalStateException("onlyScaleDown can not be applied without resize");
}
this.i = true;
return this;
}
public final Builder priority(Picasso.Priority paramPriority)
{
if (paramPriority == null) {
throw new IllegalArgumentException("Priority invalid.");
}
if (this.c != null) {
throw new IllegalStateException("Priority already set.");
}
this.c = paramPriority;
return this;
}
public final Builder resize(int paramInt1, int paramInt2)
{
if (paramInt1 < 0) {
throw new IllegalArgumentException("Width must be positive number or 0.");
}
if (paramInt2 < 0) {
throw new IllegalArgumentException("Height must be positive number or 0.");
}
if ((paramInt2 == 0) && (paramInt1 == 0)) {
throw new IllegalArgumentException("At least one dimension has to be positive number.");
}
this.a = paramInt1;
this.b = paramInt2;
return this;
}
public final Builder rotate(float paramFloat)
{
this.j = paramFloat;
return this;
}
public final Builder rotate(float paramFloat1, float paramFloat2, float paramFloat3)
{
this.j = paramFloat1;
this.k = paramFloat2;
this.l = paramFloat3;
this.m = true;
return this;
}
public final Builder setResourceId(int paramInt)
{
if (paramInt == 0) {
throw new IllegalArgumentException("Image resource ID may not be 0.");
}
this.e = paramInt;
this.d = null;
return this;
}
public final Builder setUri(Uri paramUri)
{
if (paramUri == null) {
throw new IllegalArgumentException("Image URI may not be null.");
}
this.d = paramUri;
this.e = 0;
return this;
}
public final Builder stableKey(String paramString)
{
this.f = paramString;
return this;
}
public final Builder transform(Transformation paramTransformation)
{
if (paramTransformation == null) {
throw new IllegalArgumentException("Transformation must not be null.");
}
if (paramTransformation.key() == null) {
throw new IllegalArgumentException("Transformation key must not be null.");
}
if (this.n == null) {
this.n = new ArrayList(2);
}
this.n.add(paramTransformation);
return this;
}
public final Builder transform(List<? extends Transformation> paramList)
{
if (paramList == null) {
throw new IllegalArgumentException("Transformation list must not be null.");
}
int i2 = paramList.size();
int i1 = 0;
while (i1 < i2)
{
transform((Transformation)paramList.get(i1));
i1 += 1;
}
return this;
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/squareup/picasso/Request.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/