what-the-bank/sources/com/scb/phone/view/fragment/transferandpay/SuccessFragment.java

1037 lines
39 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.transferandpay;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
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.HomeActivity;
import com.scb.phone.view.activity.donations.SharingMomentsPreviewActivity;
import com.scb.phone.view.activity.requesttopay.EnterProxyActivity;
import com.scb.phone.view.activity.requesttopay.SummaryDetailActivity;
import com.scb.phone.view.activity.transferandpay.SuccessActivity;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.custom.common.CustomInputDialog;
import com.scb.phone.view.custom.common.DefaultButton;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPayTarget;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.transferandpay.SuccessFragment;
import java.io.File;
import java.util.List;
import java.util.Objects;
import o.AbstractC13482fbE;
import o.C0375Fe;
import o.C0693Mj;
import o.C1191Xp;
import o.C12644fDG;
import o.C12944fLv;
import o.C6583cXR;
import o.EnumC8951daY;
import o.FVz;
import o.InterfaceC13391fZD;
import o.InterfaceC15577gud;
import o.InterfaceC9010dbe;
import o.JF;
import o.cNJ;
import o.eBM;
import o.fDK;
import o.fDQ;
import o.fHN;
import o.fJM;
import o.fSQ;
import o.guQ;
import o.nMh;
import o.pug;
import org.jmrtd.lds.ImageInfo;
/* loaded from: classes5.dex */
public class SuccessFragment extends Hilt_SuccessFragment implements InterfaceC9010dbe.SWS, ViewTreeObserver.OnGlobalLayoutListener, fHN {
@BindView
RecyclerView additionalRecyclerView;
@BindView
Button anotherTransactionButton;
@BindView
Button autoSaveOffDonationsSaveButton;
@BindView
Button autoSaveOffSaveButton;
@BindView
Button autoSaveOffShareButton;
@BindView
LinearLayout billLinearLayout;
@BindView
RelativeLayout billPaymentRelativeLayout;
@BindView
TextView coachmarkQRCodeSectionDescription;
@BindView
TextView coachmarkQRCodeSectionHeader;
@BindView
FrameLayout contextualAdsLayout;
public C1191Xp d;
@BindView
ImageView endSlipImage;
@BindView
ImageView expandIcon;
private Uri f;
private boolean h;
private CustomInputDialog i;
@BindView
View lineBlackView;
@BindView
View lineView;
@BindView
DefaultButton mFavouriteButton;
@BindView
ImageView mOverlayQRCodeSectionCoachmarkImageView;
@BindView
RelativeLayout mQRCodeSectionCoachmarkContainer;
@BindView
TextView mRemainingBalanceTextView;
@BindView
RelativeLayout mRootView;
@BindView
public TextView qrCodeDescriptionTextView;
@BindView
public ImageView qrCodeImageView;
@BindView
LinearLayout qrCodeLayout;
@BindView
public TextView qrCodeSectionHeaderTextView;
@BindView
LinearLayout qrCodeSectionView;
@BindView
TextView refIdTextView;
@BindView
TextView returnTextView;
@BindView
TextView scheduleNote;
@BindView
Button shareButton;
@BindView
Button shareMomentButton;
@BindView
RelativeLayout slipRelativeLayout;
@InterfaceC13391fZD
public cNJ successPresenter;
@InterfaceC13391fZD
public C12944fLv successScreenshotHelper;
private boolean c = false;
private boolean j = false;
@Override // o.InterfaceC9010dbe.SWS
public final void e(String str, String str2, String str3) {
}
public static SuccessFragment d(C1191Xp c1191Xp, String str) {
Bundle bundle = new Bundle();
bundle.putParcelable("com.scb.phone.EXTRA_SUCCESS", c1191Xp);
bundle.putString("EXTRA_POINT_X_CUSTOMER_ID", str);
SuccessFragment successFragment = new SuccessFragment();
successFragment.setArguments(bundle);
return successFragment;
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
String string;
char c;
String lowerCase;
char c2;
int i;
View inflate = layoutInflater.inflate(R.layout.2131559961, viewGroup, false);
Bundle arguments = getArguments();
if (arguments != null) {
C1191Xp c1191Xp = (C1191Xp) arguments.getParcelable("com.scb.phone.EXTRA_SUCCESS");
this.d = c1191Xp;
if (c1191Xp != null) {
this.successPresenter.e((cNJ) this);
this.successPresenter.d(this.d);
a(this.d, inflate, getContext());
boolean z = (!TextUtils.isEmpty(this.d.n) || this.d.j == null || this.d.j.b.isEmpty()) ? false : true;
if (this.d.p.at != null) {
this.mFavouriteButton.setVisibility(8);
this.mRemainingBalanceTextView.setVisibility(8);
this.scheduleNote.setVisibility(0);
} else if (!z) {
this.successPresenter.a();
}
TextView textView = this.mRemainingBalanceTextView;
C1191Xp c1191Xp2 = this.d;
if ("PP_SCB".equalsIgnoreCase(c1191Xp2.p.j()) || "PRESENT_TRANSFER_TYPE".equalsIgnoreCase(c1191Xp2.p.aE) || "rtp.payer".equalsIgnoreCase(c1191Xp2.p.j()) || "PURCHASE_CREDIT_CARD_FUNCTION".equalsIgnoreCase(c1191Xp2.p.j())) {
string = getString(R.string.remaining_balance_no_baht);
} else {
string = getString(R.string.remaining_balance);
}
String j = this.d.p.j();
j.hashCode();
switch (j.hashCode()) {
case -1927841485:
if (j.equals("PP_SCB")) {
c = 0;
break;
}
c = 65535;
break;
case -1844260907:
if (j.equals("rtp.payer")) {
c = 1;
break;
}
c = 65535;
break;
case -809785874:
if (j.equals("PURCHASE_TRANSFER_FUNCTION")) {
c = 2;
break;
}
c = 65535;
break;
case -658782923:
if (j.equals("RTP_EBILL_PAYMENT_FUNCTION")) {
c = 3;
break;
}
c = 65535;
break;
case -562916618:
if (j.equals("LOANPAYMENT")) {
c = 4;
break;
}
c = 65535;
break;
case -522396193:
if (j.equals("PURCHASE_CREDIT_CARD_FUNCTION")) {
c = 5;
break;
}
c = 65535;
break;
case -486974465:
if (j.equals("BILLPAYMENT")) {
c = 6;
break;
}
c = 65535;
break;
case -445320196:
if (j.equals("rtp.requester")) {
c = 7;
break;
}
c = 65535;
break;
case -84093019:
if (j.equals("PURCHASE_TOPUP_FUNCTION")) {
c = '\b';
break;
}
c = 65535;
break;
case 51621:
if (j.equals("3RD")) {
c = '\t';
break;
}
c = 65535;
break;
case 80008848:
if (j.equals("TOPUP")) {
c = '\n';
break;
}
c = 65535;
break;
case 467738251:
if (j.equals("PURCHASE_BILL_PAYMENT_FUNCTION")) {
c = 11;
break;
}
c = 65535;
break;
case 2063509483:
if (j.equals("TRANSFER")) {
c = '\f';
break;
}
c = 65535;
break;
default:
c = 65535;
break;
}
switch (c) {
case 0:
case 2:
case 5:
case '\b':
case 11:
lowerCase = getString(R.string.purchase_remaining_limit).toLowerCase();
break;
case 1:
case '\f':
lowerCase = getString(R.string.transfer_tab).toLowerCase();
break;
case 3:
case 6:
lowerCase = getString(R.string.bill_payment_remaining_limit).toLowerCase();
break;
case 4:
lowerCase = getString(R.string.loan_payment_remaining_limit).toLowerCase();
break;
case 7:
lowerCase = getString(R.string.request_to_pay).toLowerCase();
break;
case '\t':
lowerCase = getString(R.string.gifting_transaction).toLowerCase();
break;
case '\n':
lowerCase = getString(R.string.top_up_tab).toLowerCase();
break;
default:
lowerCase = "";
break;
}
textView.setText(String.format(string, lowerCase, this.d.t));
if (!TextUtils.isEmpty(this.d.g)) {
this.mFavouriteButton.setVisibility(8);
}
String j2 = this.d.p.j();
j2.hashCode();
switch (j2.hashCode()) {
case -1844260907:
if (j2.equals("rtp.payer")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case -809785874:
if (j2.equals("PURCHASE_TRANSFER_FUNCTION")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case -658782923:
if (j2.equals("RTP_EBILL_PAYMENT_FUNCTION")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case -522396193:
if (j2.equals("PURCHASE_CREDIT_CARD_FUNCTION")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case -486974465:
if (j2.equals("BILLPAYMENT")) {
c2 = 4;
break;
}
c2 = 65535;
break;
case -445320196:
if (j2.equals("rtp.requester")) {
c2 = 5;
break;
}
c2 = 65535;
break;
case 467738251:
if (j2.equals("PURCHASE_BILL_PAYMENT_FUNCTION")) {
c2 = 6;
break;
}
c2 = 65535;
break;
case 499385956:
if (j2.equals("rtp.payer.notification")) {
c2 = 7;
break;
}
c2 = 65535;
break;
case 2063509483:
if (j2.equals("TRANSFER")) {
c2 = '\b';
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
this.mFavouriteButton.setVisibility(8);
i = 0;
this.anotherTransactionButton.setVisibility(0);
this.anotherTransactionButton.setText(getString(R.string.view_all_request_payment));
break;
case 1:
case 4:
case 6:
case '\b':
if (this.d.p.P == null && this.d.n != null && !this.d.n.isEmpty()) {
this.mRootView.getViewTreeObserver().addOnGlobalLayoutListener(this);
this.qrCodeLayout.setVisibility(0);
this.refIdTextView.setText(this.d.l);
y();
C6583cXR.d(this.d.n, 500, 500, FVz.M).subscribe(new fSQ(this) { // from class: o.fDE
private SuccessFragment a;
@Override // o.fSQ
public final void c(Object obj) {
SuccessFragment successFragment = this.a;
Bitmap bitmap = (Bitmap) obj;
if ("TRANSFER".equals(successFragment.d.p.j())) {
successFragment.qrCodeSectionHeaderTextView.setText(successFragment.getString(com.scb.phone.R.string.successful_qr_code_transfer_header));
successFragment.qrCodeDescriptionTextView.setText(successFragment.getString(com.scb.phone.R.string.successful_qr_code_transfer_description));
} else if ("BILLPAYMENT".equals(successFragment.d.p.j())) {
successFragment.qrCodeSectionHeaderTextView.setText(successFragment.getString(com.scb.phone.R.string.successful_qr_code_bill_payment_header));
successFragment.qrCodeDescriptionTextView.setText(successFragment.getString(com.scb.phone.R.string.successful_qr_code_bill_payment_description));
}
successFragment.qrCodeImageView.setImageBitmap(bitmap);
Dialog dialog = ((BaseFragment) successFragment).e;
if (dialog == null || !dialog.isShowing()) {
return;
}
((BaseFragment) successFragment).e.dismiss();
((BaseFragment) successFragment).e = null;
}
{
this.a = this;
}
}, new fSQ(this) { // from class: o.fDI
private SuccessFragment e;
@Override // o.fSQ
public final void c(Object obj) {
SuccessFragment.e(this.e);
}
{
this.e = this;
}
});
}
i = 0;
break;
case 2:
case 3:
this.mFavouriteButton.setVisibility(8);
this.successPresenter.c(this.d);
i = 0;
break;
case 5:
if (getContext() != null) {
this.mFavouriteButton.setVisibility(8);
this.lineBlackView.setVisibility(8);
this.lineView.setVisibility(8);
this.endSlipImage.setVisibility(8);
this.anotherTransactionButton.setVisibility(0);
this.anotherTransactionButton.setText(getString(R.string.make_another_request));
this.returnTextView.setText(getString(R.string.view_all_request));
this.billPaymentRelativeLayout.setBackgroundResource(0);
this.billLinearLayout.setBackgroundResource(0);
this.billPaymentRelativeLayout.setBackgroundColor(nMh.getColor(getContext(), R.color.f3032131099810));
this.billLinearLayout.setBackgroundColor(nMh.getColor(getContext(), R.color.f14042131100912));
this.slipRelativeLayout.setBackgroundColor(nMh.getColor(getContext(), R.color.f14042131100912));
}
i = 0;
break;
case 7:
this.mFavouriteButton.setVisibility(8);
this.anotherTransactionButton.setVisibility(0);
this.anotherTransactionButton.setText(getString(R.string.view_all_notification_request));
i = 0;
break;
default:
i = 0;
break;
}
if (z) {
this.userNote.divider.setVisibility(i);
e(getContext(), this.additionalRecyclerView, this.d.j.b, this, true);
if (d(this.d) && getActivity() != null) {
this.userNote.divider.setVisibility(8);
this.endSlipImage.setBackgroundColor(nMh.getColor(getActivity(), R.color.f14042131100912));
}
}
}
}
return inflate;
}
@Override // o.InterfaceC9010dbe.SWS
public final void r() {
this.customTarget.setAddFavoriteButtonVisible(true);
}
@Override // o.InterfaceC9010dbe.SWS
public final void a(String str) {
this.customTarget.setFavoriteName(str);
}
@Override // o.InterfaceC9010dbe.SWS
public final void c(List<C0375Fe> list) {
this.contextualAdsLayout.setVisibility(0);
AbstractC13482fbE a = getChildFragmentManager().a();
a.b(R.id.fl_fragment_contextual_ads, ContextualAdsFragment.a("TRANSFER", list, "ADS_TRANSFER_TYPE"), null, 2);
a.b();
}
@Override // o.InterfaceC9010dbe.SWS
public final void c() {
CustomTransferAndPayTarget customTransferAndPayTarget = this.customTarget;
customTransferAndPayTarget.mFavouriteIcon.setVisibility(8);
customTransferAndPayTarget.mFavouriteName.setVisibility(8);
this.customTarget.setAddFavoriteButtonVisible(false);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
cNJ cnj = this.successPresenter;
if (cnj != null) {
cnj.w_();
}
super.onDestroy();
}
@Override // androidx.fragment.app.Fragment
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
fDQ.b(this, i, iArr);
}
public final void d(boolean z) {
Context context = getContext();
if (isDetached() || context == null || this.h || this.d.p.at != null) {
return;
}
this.h = !z;
this.successScreenshotHelper.d(this.d, context, true, z, false).subscribe(new fDK(this), new C12644fDG(this));
}
public final void d(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.fDP
private InterfaceC15577gud b;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.b.c();
}
{
this.b = interfaceC15577gud;
}
}), Integer.valueOf(R.string.permission_deny), new DialogInterface.OnClickListener(interfaceC15577gud) { // from class: o.fDO
private InterfaceC15577gud a;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
this.a.e();
}
{
this.a = interfaceC15577gud;
}
}})).show();
}
public static void B() {
guQ.b("onPermissionDenied", new Object[0]);
}
public static void w() {
guQ.b("onNeverAskAgain", new Object[0]);
}
private void d(File file) {
if (file.isDirectory() && file.listFiles() != null) {
for (File file2 : (File[]) Objects.requireNonNull(file.listFiles())) {
d(file2);
}
}
try {
file.deleteOnExit();
guQ.e("SuccessFragment: File deleted", new Object[0]);
} catch (SecurityException e) {
StringBuilder sb = new StringBuilder("SuccessFragment: File not deleted: ");
sb.append(e.getMessage());
guQ.a(sb.toString(), new Object[0]);
}
}
public static void A() {
guQ.b("onPermissionDeniedAndroid13", new Object[0]);
}
public static void z() {
guQ.b("onNeverAskAgainAndroid13", new Object[0]);
}
@OnClick
@Optional
public void onShareButtonClick() {
Uri uri = this.f;
if (uri == null || uri.toString().isEmpty()) {
e(R.string.share_error, EnumC8951daY.ERROR);
return;
}
if (getActivity() != null) {
if (a(this.d)) {
((BaseActivity) getActivity()).scbAnalytics.e("share_slip_action", new pug("source", "movie"));
} else if (D()) {
((BaseActivity) getActivity()).scbAnalytics.e("billpay_slip", new pug("source", Q()), new pug("subtype", O()), new pug("button", "share_slip"));
} else {
((BaseActivity) getActivity()).scbAnalytics.c("share_slip_action");
}
}
Intent intent = new Intent("android.intent.action.SEND");
intent.setType(ImageInfo.JPEG_MIME_TYPE);
intent.addFlags(1);
intent.putExtra("android.intent.extra.STREAM", this.f);
startActivity(Intent.createChooser(intent, getString(R.string.share_slip)));
}
@OnClick
@Optional
public void onAnotherTransferClick() {
char c;
if (getActivity() instanceof SuccessActivity) {
String j = this.d.p.j();
j.hashCode();
int hashCode = j.hashCode();
if (hashCode == -1844260907) {
if (j.equals("rtp.payer")) {
c = 0;
}
c = 65535;
} else if (hashCode != -445320196) {
if (hashCode == 499385956 && j.equals("rtp.payer.notification")) {
c = 2;
}
c = 65535;
} else {
if (j.equals("rtp.requester")) {
c = 1;
}
c = 65535;
}
if (c == 0) {
Intent intent = new Intent(getContext(), (Class<?>) SummaryDetailActivity.class);
intent.addFlags(603979776);
intent.putExtra("com.scb.phone.Constants.RequestToPay.EXTRA_REQUESTER_REQ_STATUS", "COMPLETED");
startActivity(intent);
if (getActivity() != null) {
getActivity().finish();
return;
}
return;
}
if (c == 1) {
Intent intent2 = new Intent(getContext(), (Class<?>) EnterProxyActivity.class);
intent2.addFlags(603979776);
intent2.putExtra("com.scb.phone.Constants.RequestToPay.EXTRA_REQUESTER_REQ_STATUS", "ANOTHER");
startActivity(intent2);
if (getActivity() != null) {
getActivity().finish();
return;
}
return;
}
if (c != 2) {
return;
}
Intent intent3 = new Intent((SuccessActivity) getActivity(), (Class<?>) HomeActivity.class);
intent3.addFlags(268468224);
intent3.putExtra("com.scb.phone.EXTRA_NEW_INSTANCE_LAYOUT", R.id.notification_tab);
intent3.putExtra("com.scb.phone.EXTRA_NEW_INSTANCE_REFRESH", true);
startActivity(intent3);
getActivity().finish();
}
}
@OnClick
@Optional
public void onReturnHomeClick() {
if (getActivity() instanceof SuccessActivity) {
if (TextUtils.equals("rtp.requester", this.d.p.j())) {
Intent intent = new Intent(getContext(), (Class<?>) EnterProxyActivity.class);
intent.addFlags(603979776);
intent.putExtra("com.scb.phone.Constants.RequestToPay.EXTRA_REQUESTER_REQ_STATUS", "COMPLETED");
startActivity(intent);
getActivity().finish();
return;
}
if (TextUtils.equals("rtp.payer.notification", this.d.p.j())) {
Intent amA_ = ((SuccessActivity) getActivity()).amA_();
amA_.addFlags(268468224);
startActivity(amA_);
getActivity().finish();
return;
}
if (!HomeActivity.r()) {
getActivity().finishAffinity();
}
startActivity(((SuccessActivity) getActivity()).amA_());
}
}
@OnClick
@Optional
public void onAddFavoriteClick() {
CustomInputDialog b = CustomInputDialog.b(getContext());
this.i = b;
String string = getString(R.string.favourite_name);
if (string != null) {
b.mTitleTextView.setVisibility(0);
b.mTitleTextView.setText(string);
}
this.i.mEditTextView.addTextChangedListener(new TextWatcher(this) { // from class: com.scb.phone.view.fragment.transferandpay.SuccessFragment.3
private SuccessFragment d;
@Override // android.text.TextWatcher
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
AnonymousClass3(SuccessFragment this) {
this.d = this;
}
@Override // android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
this.d.i.mErrorTextView.setVisibility(8);
}
});
this.i.mEditTextView.setFilters(new InputFilter[]{new InputFilter.LengthFilter(20)});
this.i.setCanceledOnTouchOutside(false);
this.i.mEditTextView.setVisibility(0);
this.i.apc_(R.string.cancel, new DialogInterface.OnClickListener() { // from class: o.fDJ
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
CustomInputDialog customInputDialog = this.i;
String string2 = getString(R.string.add_favourite);
DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener(this) { // from class: o.fDM
private SuccessFragment b;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
SuccessFragment.b(this.b);
}
{
this.b = this;
}
};
if (string2 != null) {
customInputDialog.mPositiveButton.setText(string2);
customInputDialog.mPositiveButton.setOnClickListener(new eBM(customInputDialog, onClickListener, false));
}
if (!isAdded() || getContext() == null) {
return;
}
this.i.show();
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: com.scb.phone.view.fragment.transferandpay.SuccessFragment$3 */
/* loaded from: classes5.dex */
public final class AnonymousClass3 implements TextWatcher {
private SuccessFragment d;
@Override // android.text.TextWatcher
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
AnonymousClass3(SuccessFragment this) {
this.d = this;
}
@Override // android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
this.d.i.mErrorTextView.setVisibility(8);
}
}
@Override // o.InterfaceC9010dbe.SWS
public final void c(String str) {
e(R.string.favourite_added_successfully, EnumC8951daY.SUCCESS);
CustomInputDialog customInputDialog = this.i;
if (customInputDialog != null) {
customInputDialog.dismiss();
}
this.customTarget.setFavoriteName(str);
this.customTarget.setAddFavoriteButtonVisible(false);
}
@Override // o.InterfaceC9010dbe.SWS
public final void e(JF jf) {
SharingMomentsPreviewActivity.e(getContext(), jf);
}
@OnClick
public void saveSlipButton() {
this.j = true;
b(true);
}
@OnClick
public void saveSlipDonationsButton() {
this.j = true;
b(true);
}
@OnClick
public void setShareMomentButton() {
this.successPresenter.b(this.d);
}
@Override // o.InterfaceC9010dbe.SWS
public final void k() {
c("billpay_slip", new pug("source", Q()), new pug("subtype", O()), new pug("button", "share_moment"));
}
@OnClick
public void shareSlipButton() {
onShareButtonClick();
}
private void e(int i, EnumC8951daY enumC8951daY) {
FragmentActivity activity = getActivity();
if (activity != null) {
String string = getString(i);
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);
}
}
}
@OnClick
public void onClickQRCodeLayout() {
if (this.qrCodeSectionView.getVisibility() == 8) {
fJM.e(this.qrCodeSectionView);
} else {
fJM.d(this.qrCodeSectionView);
}
fJM.b(this.expandIcon);
}
@Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
public void onGlobalLayout() {
this.mRootView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
@OnClick
public void closeTutorial() {
this.mRootView.removeView(this.mQRCodeSectionCoachmarkContainer);
this.mRootView.removeView(this.mOverlayQRCodeSectionCoachmarkImageView);
}
@Override // o.fHN
public final void s() {
if (getContext() != null) {
this.successPresenter.a();
}
}
public static /* synthetic */ void b(SuccessFragment successFragment, Throwable th) {
guQ.a(th, "onSaveScreenshotError", new Object[0]);
FragmentActivity activity = successFragment.getActivity();
if (successFragment.isDetached() || activity == null) {
return;
}
EnumC8951daY enumC8951daY = EnumC8951daY.ERROR;
FragmentActivity activity2 = successFragment.getActivity();
if (activity2 != null) {
String string = successFragment.getString(R.string.saved_slip_error);
if (successFragment.getActivity() != null) {
BaseActivity.a(new Object[]{(BaseActivity) successFragment.getActivity(), activity2, Integer.valueOf(R.id.success_view_container), string, enumC8951daY}, 855668825, -855668822, R.id.success_view_container);
}
}
}
public static /* synthetic */ void axQ_(SuccessFragment successFragment, Uri uri) {
successFragment.f = uri;
FragmentActivity activity = successFragment.getActivity();
if (uri.toString().isEmpty() || !successFragment.getUserVisibleHint() || activity == null || !successFragment.j) {
return;
}
EnumC8951daY enumC8951daY = EnumC8951daY.SUCCESS;
FragmentActivity activity2 = successFragment.getActivity();
if (activity2 != null) {
String string = successFragment.getString(R.string.saved_slip);
if (successFragment.getActivity() != null) {
BaseActivity.a(new Object[]{(BaseActivity) successFragment.getActivity(), activity2, Integer.valueOf(R.id.success_view_container), string, enumC8951daY}, 855668825, -855668822, R.id.success_view_container);
}
}
successFragment.j = false;
if (successFragment.getContext() != null) {
successFragment.d(new File(successFragment.getContext().getCacheDir(), "pullslip"));
}
}
public static /* synthetic */ void b(SuccessFragment successFragment) {
if (String.valueOf(successFragment.i.mEditTextView.getText()) != null) {
if (((Boolean) C6583cXR.c(new Object[]{String.valueOf(successFragment.i.mEditTextView.getText())}, -1032102340, 1032102340, (int) System.currentTimeMillis())).booleanValue()) {
successFragment.successPresenter.e(successFragment.d, String.valueOf(successFragment.i.mEditTextView.getText()));
return;
}
CustomInputDialog customInputDialog = successFragment.i;
String string = successFragment.getString(R.string.favorite_invalid_character);
customInputDialog.mErrorTextView.setVisibility(0);
customInputDialog.mErrorTextView.setText(string);
}
}
public static /* synthetic */ void e(SuccessFragment successFragment) {
if (successFragment.getContext() != null) {
successFragment.qrCodeImageView.setVisibility(8);
successFragment.refIdTextView.setTextColor(nMh.getColor(successFragment.getContext(), R.color.f13682131100876));
successFragment.refIdTextView.setTextSize(2, successFragment.getResources().getDimensionPixelSize(R.dimen.f28282131166594) / successFragment.getResources().getDisplayMetrics().density);
if ("TRANSFER".equals(successFragment.d.p.j())) {
successFragment.qrCodeDescriptionTextView.setText(successFragment.getString(R.string.successful_qr_code_no_qr_code_transfer_header));
} else if ("BILLPAYMENT".equals(successFragment.d.p.j())) {
successFragment.qrCodeDescriptionTextView.setText(successFragment.getString(R.string.successful_qr_code_no_qr_code_bill_payment_header));
}
successFragment.ar_();
}
}
private void b(boolean z) {
if (getActivity() != null) {
if (BaseActivity.P()) {
fDQ.b(this, z);
return;
}
}
fDQ.e(this, z);
}
@Override // o.InterfaceC9010dbe.SWS
public final void c(C0693Mj c0693Mj) {
String str;
CustomInputDialog customInputDialog = this.i;
if (customInputDialog == null) {
return;
}
if (c0693Mj.c.length() > 0) {
str = c0693Mj.c;
} else {
str = c0693Mj.d;
}
customInputDialog.mErrorTextView.setVisibility(0);
customInputDialog.mErrorTextView.setText(str);
}
@Override // o.InterfaceC9010dbe.SWS
public final void l() {
this.c = true;
this.j = true;
if (!this.d.m) {
this.shareButton.setVisibility(0);
this.autoSaveOffSaveButton.setVisibility(8);
this.autoSaveOffShareButton.setVisibility(8);
} else {
this.shareButton.setVisibility(8);
this.shareMomentButton.setVisibility(0);
this.autoSaveOffShareButton.setVisibility(0);
}
b(false);
}
@Override // o.InterfaceC9010dbe.SWS
public final void m() {
Context context = getContext();
if (!isDetached() && context != null) {
this.successScreenshotHelper.d(this.d, context, this.c, false, false).subscribe(new fDK(this), new C12644fDG(this));
}
this.c = false;
this.j = false;
if (!this.d.m) {
this.autoSaveOffSaveButton.setVisibility(0);
this.autoSaveOffShareButton.setVisibility(0);
this.shareButton.setVisibility(8);
} else {
this.shareButton.setVisibility(8);
this.shareMomentButton.setVisibility(0);
this.autoSaveOffShareButton.setVisibility(0);
this.autoSaveOffDonationsSaveButton.setVisibility(0);
}
}
}