package com.scb.phone.view.fragment.chequemanagement; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.widget.Space; import android.widget.TextView; import androidx.fragment.app.FragmentActivity; import butterknife.BindView; import butterknife.OnClick; import butterknife.Optional; import com.scb.phone.R; import com.scb.phone.view.activity.BaseActivity; import com.scb.phone.view.activity.chequemanagement.ChequeSuccessActivity; import com.scb.phone.view.activity.chequemanagement.stopcheque.StopChequeLandingActivity; import com.scb.phone.view.custom.common.CustomDialog; import com.scb.phone.view.custom.common.DefaultButton; import com.scb.phone.view.fragment.chequemanagement.ChequeSuccessFragment; import o.AbstractC13163fSk; import o.C10730eMy; import o.C1191Xp; import o.C13417fZt; import o.C3382awW; import o.EnumC8951daY; import o.InterfaceC13391fZD; import o.InterfaceC15577gud; import o.cYE; import o.fKX; import o.fRR; import o.fSQ; import o.guQ; import org.bouncycastle.asn1.cmp.PKIFailureInfo; import org.jmrtd.lds.ImageInfo; /* loaded from: classes5.dex */ public class ChequeSuccessFragment extends Hilt_ChequeSuccessFragment implements cYE.LWm { @BindView DefaultButton autoSaveOffSaveButton; private Uri c; private String d; @BindView TextView dateTimeTextView; private boolean f; private C1191Xp h; @InterfaceC13391fZD public C3382awW presenter; @BindView TextView refIdTextView; @BindView TextView remainingBalanceTextView; @BindView TextView returnButtonTextView; @BindView DefaultButton shareButton; @BindView Space spaceBetweenButton; @BindView TextView titleSuccessTextView; public static /* synthetic */ void d() throws Throwable { } public static ChequeSuccessFragment a(C1191Xp c1191Xp) { ChequeSuccessFragment chequeSuccessFragment = new ChequeSuccessFragment(); Bundle bundle = new Bundle(); bundle.putParcelable("com.scb.phone.EXTRA_SUCCESS", c1191Xp); chequeSuccessFragment.setArguments(bundle); return chequeSuccessFragment; } /* JADX WARN: Removed duplicated region for block: B:14:0x006f */ /* JADX WARN: Removed duplicated region for block: B:23:0x00e0 */ @Override // androidx.fragment.app.Fragment /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public android.view.View onCreateView(android.view.LayoutInflater r6, android.view.ViewGroup r7, android.os.Bundle r8) { /* Method dump skipped, instructions count: 277 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.scb.phone.view.fragment.chequemanagement.ChequeSuccessFragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle):android.view.View"); } @Override // androidx.fragment.app.Fragment public void onStart() { super.onStart(); Uri uri = this.c; if (uri == null || uri.toString().isEmpty()) { Context context = getContext(); if (isDetached() || context == null) { return; } AbstractC13163fSk.fromCallable(new fKX(this.h, context, false)).observeOn(fRR.e()).subscribeOn(C13417fZt.b()).subscribe(new fSQ(this) { // from class: o.eMw private ChequeSuccessFragment a; @Override // o.fSQ public final void c(Object obj) { this.a.c = (Uri) obj; } { this.a = this; } }, new fSQ() { // from class: o.eMz @Override // o.fSQ public final void c(Object obj) { ChequeSuccessFragment.d(); } }); } } @Override // o.cYE.LWm public final void b() { this.f = true; this.autoSaveOffSaveButton.setVisibility(8); if ("ORDER_CHEQUE_FUNCTION".equalsIgnoreCase(this.h.p.j())) { this.shareButton.setVisibility(0); } l(); } @Override // o.cYE.LWm public final void c() { this.f = false; if ("STOP_CHEQUE_FUNCTION".equals(this.d)) { this.autoSaveOffSaveButton.setVisibility(8); } else { this.autoSaveOffSaveButton.setVisibility(0); } if ("ORDER_CHEQUE_FUNCTION".equalsIgnoreCase(this.h.p.j())) { this.shareButton.setVisibility(0); this.spaceBetweenButton.setVisibility(0); } } @Override // androidx.fragment.app.Fragment public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) { super.onRequestPermissionsResult(i, strArr, iArr); C10730eMy.c(this, i, iArr); } public final void i() { Context context = getContext(); if (isDetached() || context == null) { return; } AbstractC13163fSk.fromCallable(new fKX(this.h, context, true)).observeOn(fRR.e()).subscribeOn(C13417fZt.b()).subscribe(new fSQ(this) { // from class: o.eMq private ChequeSuccessFragment d; @Override // o.fSQ public final void c(Object obj) { ChequeSuccessFragment.arj_(this.d, (Uri) obj); } { this.d = this; } }, new fSQ(this) { // from class: o.eMu private ChequeSuccessFragment b; @Override // o.fSQ public final void c(Object obj) { ChequeSuccessFragment.c(this.b, (Throwable) obj); } { this.b = this; } }); } public final void c(final InterfaceC15577gud interfaceC15577gud) { guQ.b("onShowRationale", new Object[0]); ((CustomDialog) CustomDialog.e(new Object[]{CustomDialog.b(getContext()).c(R.string.permission_storage_title).d(R.string.permission_storage).aoT_(R.string.permission_allow, new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.eMs private InterfaceC15577gud a; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { this.a.c(); } { this.a = interfaceC15577gud; } }), Integer.valueOf(R.string.permission_deny), new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.eMx private InterfaceC15577gud b; @Override // android.content.DialogInterface.OnClickListener public final void onClick(DialogInterface dialogInterface, int i) { this.b.e(); } { this.b = interfaceC15577gud; } }})).show(); } public static void h() { guQ.b("onNeverAskAgain", new Object[0]); } public static void f() { guQ.b("onPermissionDenied", new Object[0]); } public static void g() { guQ.b("onNeverAskAgainAndroid13", new Object[0]); } public static void j() { guQ.b("onPermissionDeniedAndroid13", new Object[0]); } /* JADX INFO: Access modifiers changed from: package-private */ @OnClick public void saveSlipButton() { this.f = true; l(); } /* JADX INFO: Access modifiers changed from: package-private */ @OnClick @Optional public void onShareButtonClick() { Uri uri = this.c; if (uri == null || uri.toString().isEmpty()) { EnumC8951daY enumC8951daY = EnumC8951daY.ERROR; FragmentActivity activity = getActivity(); if (activity != null) { String string = getString(R.string.share_error); if (getActivity() != null) { BaseActivity.a(new Object[]{(BaseActivity) getActivity(), activity, Integer.valueOf(R.id.success_view_container), string, enumC8951daY}, 855668825, -855668822, R.id.success_view_container); } } } Intent intent = new Intent("android.intent.action.SEND"); intent.setType(ImageInfo.JPEG_MIME_TYPE); intent.addFlags(1); intent.putExtra("android.intent.extra.STREAM", this.c); startActivity(Intent.createChooser(intent, getString(R.string.share_slip))); } public static /* synthetic */ void c(ChequeSuccessFragment chequeSuccessFragment, Throwable th) { guQ.a(th, "onSaveScreenshotError", new Object[0]); FragmentActivity activity = chequeSuccessFragment.getActivity(); if (chequeSuccessFragment.isDetached() || activity == null) { return; } EnumC8951daY enumC8951daY = EnumC8951daY.ERROR; FragmentActivity activity2 = chequeSuccessFragment.getActivity(); if (activity2 != null) { String string = chequeSuccessFragment.getString(R.string.saved_slip_error); if (chequeSuccessFragment.getActivity() != null) { BaseActivity.a(new Object[]{(BaseActivity) chequeSuccessFragment.getActivity(), activity2, Integer.valueOf(R.id.success_view_container), string, enumC8951daY}, 855668825, -855668822, R.id.success_view_container); } } } public static /* synthetic */ void arj_(ChequeSuccessFragment chequeSuccessFragment, Uri uri) { chequeSuccessFragment.c = uri; FragmentActivity activity = chequeSuccessFragment.getActivity(); if (uri.toString().isEmpty() || !chequeSuccessFragment.getUserVisibleHint() || activity == null || !chequeSuccessFragment.f) { return; } EnumC8951daY enumC8951daY = EnumC8951daY.SUCCESS; FragmentActivity activity2 = chequeSuccessFragment.getActivity(); if (activity2 != null) { String string = chequeSuccessFragment.getString(R.string.saved_slip); if (chequeSuccessFragment.getActivity() != null) { BaseActivity.a(new Object[]{(BaseActivity) chequeSuccessFragment.getActivity(), activity2, Integer.valueOf(R.id.success_view_container), string, enumC8951daY}, 855668825, -855668822, R.id.success_view_container); } } chequeSuccessFragment.f = false; } private void l() { if (getActivity() != null) { if (BaseActivity.P()) { C10730eMy.d(this); return; } } C10730eMy.b(this); } @OnClick public void onReturnButtonIsClicked() { char c; String j = this.h.p.j(); j.hashCode(); int hashCode = j.hashCode(); if (hashCode == -1347299094) { if (j.equals("ACTIVATE_CHEQUE_FUNCTION")) { c = 0; } c = 65535; } else if (hashCode != -1174071815) { if (hashCode == -829305563 && j.equals("ORDER_CHEQUE_FUNCTION")) { c = 2; } c = 65535; } else { if (j.equals("STOP_CHEQUE_FUNCTION")) { c = 1; } c = 65535; } if (c != 0) { if (c == 1) { Intent intent = new Intent(getContext(), (Class) StopChequeLandingActivity.class); intent.addFlags(PKIFailureInfo.duplicateCertReq); startActivity(intent); getActivity().finish(); return; } if (c != 2) { return; } } if (getActivity() instanceof ChequeSuccessActivity) { U(); } } }