78 lines
3.4 KiB
Java
78 lines
3.4 KiB
Java
|
package o;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.graphics.Bitmap;
|
||
|
import android.net.Uri;
|
||
|
import android.util.DisplayMetrics;
|
||
|
import android.view.LayoutInflater;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.view.WindowManager;
|
||
|
import android.widget.ImageView;
|
||
|
import android.widget.LinearLayout;
|
||
|
import butterknife.ButterKnife;
|
||
|
import com.scb.phone.view.fragment.donations.ShareMomentScreenshotFragment;
|
||
|
import com.squareup.picasso.Picasso;
|
||
|
import java.io.IOException;
|
||
|
import java.util.Calendar;
|
||
|
|
||
|
/* renamed from: o.fLc, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes5.dex */
|
||
|
public final class C12925fLc {
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public static /* synthetic */ Uri aAv_(JF jf, Context context) throws Exception {
|
||
|
Throwable th;
|
||
|
Bitmap bitmap;
|
||
|
String format = String.format("Moment_%s.jpg", String.valueOf(Calendar.getInstance().getTimeInMillis()));
|
||
|
try {
|
||
|
LinearLayout linearLayout = new LinearLayout(context);
|
||
|
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
|
||
|
View inflate = LayoutInflater.from(context).inflate(com.scb.phone.R.layout.2131560108, (ViewGroup) linearLayout, false);
|
||
|
ShareMomentScreenshotFragment shareMomentScreenshotFragment = new ShareMomentScreenshotFragment();
|
||
|
ButterKnife.c(shareMomentScreenshotFragment, inflate);
|
||
|
shareMomentScreenshotFragment.mTitle.setText(jf.b);
|
||
|
shareMomentScreenshotFragment.mSubText.setText(jf.c);
|
||
|
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||
|
((WindowManager) context.getSystemService("window")).getDefaultDisplay().getMetrics(displayMetrics);
|
||
|
int i = displayMetrics.widthPixels;
|
||
|
try {
|
||
|
ImageView imageView = shareMomentScreenshotFragment.mSharingImage;
|
||
|
C13020fOa e = Picasso.d().e(jf.a);
|
||
|
e.a.e(i, 0);
|
||
|
imageView.setImageBitmap(e.aBt_());
|
||
|
} catch (IOException | OutOfMemoryError unused) {
|
||
|
shareMomentScreenshotFragment.mSharingImage.setImageResource(com.scb.phone.R.drawable.donations_place_holder);
|
||
|
}
|
||
|
try {
|
||
|
fLI fli = new fLI();
|
||
|
ImageView imageView2 = shareMomentScreenshotFragment.mSharingLogo;
|
||
|
C13020fOa e2 = Picasso.d().e(jf.d);
|
||
|
e2.a.c(fli);
|
||
|
e2.a.e(i, 0);
|
||
|
imageView2.setImageBitmap(e2.aBt_());
|
||
|
} catch (IOException | OutOfMemoryError unused2) {
|
||
|
shareMomentScreenshotFragment.mSharingLogo.setImageResource(com.scb.phone.R.drawable.donations_place_holder_logo);
|
||
|
}
|
||
|
DisplayMetrics displayMetrics2 = new DisplayMetrics();
|
||
|
((WindowManager) context.getSystemService("window")).getDefaultDisplay().getMetrics(displayMetrics2);
|
||
|
bitmap = C12946fLx.aAB_(inflate, displayMetrics2.widthPixels, displayMetrics2.widthPixels << 2);
|
||
|
} catch (Throwable th2) {
|
||
|
th = th2;
|
||
|
bitmap = null;
|
||
|
}
|
||
|
try {
|
||
|
Uri VN_ = C6582cXO.VN_(bitmap, format, context);
|
||
|
if (bitmap != null) {
|
||
|
bitmap.recycle();
|
||
|
}
|
||
|
return VN_;
|
||
|
} catch (Throwable th3) {
|
||
|
th = th3;
|
||
|
if (bitmap != null) {
|
||
|
bitmap.recycle();
|
||
|
}
|
||
|
throw th;
|
||
|
}
|
||
|
}
|
||
|
}
|