a.java
4.88 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
package com.instabug.library.d;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ProgressBar;
import com.instabug.library.R.id;
import com.instabug.library.R.layout;
import com.instabug.library.internal.d.a.b;
import com.instabug.library.internal.d.a.b.b;
import com.instabug.library.model.a.a;
import com.instabug.library.util.InstabugSDKLogger;
import com.instabug.library.view.ScaleImageView;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class a
extends Fragment
{
private String a;
private ProgressBar b;
private ScaleImageView c;
private float d;
private float e;
public static a a(String paramString)
{
a locala = new a();
Bundle localBundle = new Bundle();
localBundle.putString("img_url", paramString);
locala.setArguments(localBundle);
return locala;
}
public float a(float paramFloat, Context paramContext)
{
return paramContext.getResources().getDisplayMetrics().densityDpi / 160.0F * paramFloat;
}
public Bitmap a(Bitmap paramBitmap, float paramFloat1, float paramFloat2)
{
Bitmap localBitmap = Bitmap.createBitmap((int)paramFloat1, (int)paramFloat2, Bitmap.Config.ARGB_8888);
if ((paramBitmap.getWidth() < paramBitmap.getHeight()) && (paramFloat1 > paramFloat2)) {}
while ((paramBitmap.getWidth() > paramBitmap.getHeight()) && (paramFloat1 < paramFloat2)) {
return paramBitmap;
}
Canvas localCanvas = new Canvas(localBitmap);
Matrix localMatrix = new Matrix();
if (paramBitmap.getWidth() < paramBitmap.getHeight()) {
localMatrix.setScale(paramFloat1 / paramBitmap.getWidth(), paramFloat2 / paramBitmap.getHeight());
}
for (;;)
{
localCanvas.drawBitmap(paramBitmap, localMatrix, new Paint());
return localBitmap;
localMatrix.setScale(paramFloat2 / paramBitmap.getHeight(), paramFloat1 / paramBitmap.getWidth());
}
}
public void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
if (getArguments() != null) {
this.a = getArguments().getString("img_url");
}
while (paramBundle == null) {
return;
}
this.a = paramBundle.getString("img_url");
}
@Nullable
public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
{
paramLayoutInflater = paramLayoutInflater.inflate(R.layout.instabug_lyt_attachment, paramViewGroup, false);
this.b = ((ProgressBar)paramLayoutInflater.findViewById(R.id.instabug_attachment_progress_bar));
this.c = ((ScaleImageView)paramLayoutInflater.findViewById(R.id.instabug_img_attachment));
return paramLayoutInflater;
}
public void onSaveInstanceState(Bundle paramBundle)
{
super.onSaveInstanceState(paramBundle);
paramBundle.putString("img_url", this.a);
}
public void onViewCreated(View paramView, @Nullable Bundle paramBundle)
{
super.onViewCreated(paramView, paramBundle);
paramView = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(paramView);
this.d = (paramView.widthPixels - (int)a(24.0F, getActivity()));
this.e = (paramView.heightPixels - (int)a(24.0F, getActivity()));
paramView = b.a(getActivity(), this.a, a.a.a);
b.a(getActivity(), paramView, new b.b()
{
public final void a(com.instabug.library.model.a paramAnonymousa)
{
InstabugSDKLogger.d(this, "Asset Entity downloaded: " + paramAnonymousa.c().getPath());
try
{
paramAnonymousa = a.this.a(BitmapFactory.decodeStream(new FileInputStream(paramAnonymousa.c())), a.a(a.this), a.b(a.this));
a.c(a.this).setImageBitmap(paramAnonymousa);
if (a.d(a.this).getVisibility() == 0) {
a.d(a.this).setVisibility(8);
}
return;
}
catch (FileNotFoundException paramAnonymousa)
{
InstabugSDKLogger.e(this, "Asset Entity downloading got FileNotFoundException error", paramAnonymousa);
}
}
public final void a(Throwable paramAnonymousThrowable)
{
InstabugSDKLogger.e(this, "Asset Entity downloading got error", paramAnonymousThrowable);
}
});
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/d/a.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/