SharedElementCallback.java
5.58 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
package android.support.v4.app;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.View;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import java.util.List;
import java.util.Map;
public abstract class SharedElementCallback
{
private static int b = 1048576;
private Matrix a;
public Parcelable onCaptureSharedElementSnapshot(View paramView, Matrix paramMatrix, RectF paramRectF)
{
ImageView localImageView;
Drawable localDrawable;
Object localObject;
if ((paramView instanceof ImageView))
{
localImageView = (ImageView)paramView;
localDrawable = localImageView.getDrawable();
localObject = localImageView.getBackground();
if ((localDrawable != null) && (localObject == null))
{
i = localDrawable.getIntrinsicWidth();
j = localDrawable.getIntrinsicHeight();
if ((i <= 0) || (j <= 0))
{
localObject = null;
if (localObject == null) {
break label294;
}
paramView = new Bundle();
paramView.putParcelable("sharedElement:snapshot:bitmap", (Parcelable)localObject);
paramView.putString("sharedElement:snapshot:imageScaleType", localImageView.getScaleType().toString());
if (localImageView.getScaleType() == ImageView.ScaleType.MATRIX)
{
paramMatrix = localImageView.getImageMatrix();
paramRectF = new float[9];
paramMatrix.getValues(paramRectF);
paramView.putFloatArray("sharedElement:snapshot:imageMatrix", paramRectF);
}
localObject = paramView;
}
}
}
label294:
do
{
do
{
return (Parcelable)localObject;
f = Math.min(1.0F, b / (i * j));
if (((localDrawable instanceof BitmapDrawable)) && (f == 1.0F))
{
localObject = ((BitmapDrawable)localDrawable).getBitmap();
break;
}
i = (int)(i * f);
j = (int)(j * f);
localObject = Bitmap.createBitmap(i, j, Bitmap.Config.ARGB_8888);
Canvas localCanvas = new Canvas((Bitmap)localObject);
Rect localRect = localDrawable.getBounds();
int k = localRect.left;
int m = localRect.top;
int n = localRect.right;
int i1 = localRect.bottom;
localDrawable.setBounds(0, 0, i, j);
localDrawable.draw(localCanvas);
localDrawable.setBounds(k, m, n, i1);
break;
j = Math.round(paramRectF.width());
i = Math.round(paramRectF.height());
localImageView = null;
localObject = localImageView;
} while (j <= 0);
localObject = localImageView;
} while (i <= 0);
float f = Math.min(1.0F, b / (j * i));
int j = (int)(j * f);
int i = (int)(i * f);
if (this.a == null) {
this.a = new Matrix();
}
this.a.set(paramMatrix);
this.a.postTranslate(-paramRectF.left, -paramRectF.top);
this.a.postScale(f, f);
paramMatrix = Bitmap.createBitmap(j, i, Bitmap.Config.ARGB_8888);
paramRectF = new Canvas(paramMatrix);
paramRectF.concat(this.a);
paramView.draw(paramRectF);
return paramMatrix;
}
public View onCreateSnapshotView(Context paramContext, Parcelable paramParcelable)
{
if ((paramParcelable instanceof Bundle))
{
paramParcelable = (Bundle)paramParcelable;
Object localObject = (Bitmap)paramParcelable.getParcelable("sharedElement:snapshot:bitmap");
if (localObject == null) {
return null;
}
paramContext = new ImageView(paramContext);
paramContext.setImageBitmap((Bitmap)localObject);
paramContext.setScaleType(ImageView.ScaleType.valueOf(paramParcelable.getString("sharedElement:snapshot:imageScaleType")));
if (paramContext.getScaleType() == ImageView.ScaleType.MATRIX)
{
paramParcelable = paramParcelable.getFloatArray("sharedElement:snapshot:imageMatrix");
localObject = new Matrix();
((Matrix)localObject).setValues(paramParcelable);
paramContext.setImageMatrix((Matrix)localObject);
}
}
for (;;)
{
return paramContext;
if ((paramParcelable instanceof Bitmap))
{
paramParcelable = (Bitmap)paramParcelable;
paramContext = new ImageView(paramContext);
paramContext.setImageBitmap(paramParcelable);
}
else
{
paramContext = null;
}
}
}
public void onMapSharedElements(List<String> paramList, Map<String, View> paramMap) {}
public void onRejectSharedElements(List<View> paramList) {}
public void onSharedElementEnd(List<String> paramList, List<View> paramList1, List<View> paramList2) {}
public void onSharedElementStart(List<String> paramList, List<View> paramList1, List<View> paramList2) {}
public void onSharedElementsArrived(List<String> paramList, List<View> paramList1, OnSharedElementsReadyListener paramOnSharedElementsReadyListener)
{
paramOnSharedElementsReadyListener.onSharedElementsReady();
}
public static abstract interface OnSharedElementsReadyListener
{
public abstract void onSharedElementsReady();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/app/SharedElementCallback.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/