what-the-bank/sources/com/scb/phone/view/fragment/ebillsubscription/EBillSubscriptionDetailFrag...

214 lines
8.2 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.ebillsubscription;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.FragmentActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.ebillsubscription.EBillSubscriptionActivity;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPaySource;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPayTarget;
import com.scb.phone.view.fragment.ebillsubscription.EBillSubscriptionDetailFragment;
import o.C0682Mc;
import o.C0693Mj;
import o.C15316gnF;
import o.C4652beH;
import o.C4694bex;
import o.C6583cXR;
import o.EnumC12253eui;
import o.EnumC8951daY;
import o.IaV;
import o.InterfaceC13391fZD;
import o.InterfaceC8932daF;
import o.ZI;
import o.gjJ;
/* loaded from: classes5.dex */
public class EBillSubscriptionDetailFragment extends Hilt_EBillSubscriptionDetailFragment implements InterfaceC8932daF.IeS {
private C0682Mc c;
@InterfaceC13391fZD
public C4694bex eBillSubscriptionDetailPresenter;
@BindView
CustomTransferAndPaySource sourceDetail;
@BindView
CustomTransferAndPaySource status;
@BindView
CustomTransferAndPayTarget targetDetail;
public static EBillSubscriptionDetailFragment e(C0682Mc c0682Mc) {
EBillSubscriptionDetailFragment eBillSubscriptionDetailFragment = new EBillSubscriptionDetailFragment();
Bundle bundle = new Bundle();
bundle.putParcelable("com.scb.phone.EXTRA_EBILL_SUBSCRIPTION_ITEM_DISPLAY", c0682Mc);
eBillSubscriptionDetailFragment.setArguments(bundle);
return eBillSubscriptionDetailFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559624, viewGroup, false);
ButterKnife.c(this, inflate);
this.eBillSubscriptionDetailPresenter.e((C4694bex) this);
final C0682Mc c0682Mc = (C0682Mc) getArguments().getParcelable("com.scb.phone.EXTRA_EBILL_SUBSCRIPTION_ITEM_DISPLAY");
this.c = c0682Mc;
C4694bex c4694bex = this.eBillSubscriptionDetailPresenter;
ZI.IeS ieS = new ZI.IeS(c0682Mc) { // from class: o.bez
private C0682Mc b;
@Override // o.ZI.IeS
public final void e(Object obj) {
C4694bex.d(this.b, (InterfaceC8932daF.IeS) obj);
}
{
this.b = c0682Mc;
}
};
if (c4694bex.f != 0) {
ieS.e(c4694bex.f);
}
aa();
return inflate;
}
@Override // o.InterfaceC8932daF.IeS
public final void b(C0682Mc c0682Mc) {
this.sourceDetail.setText(getString(R.string.promptpay_id));
if (TextUtils.equals("MOB", c0682Mc.i)) {
this.sourceDetail.setAvatar(C6583cXR.VS_(getContext(), R.drawable.icon_prompt_pay_mobile).toString());
} else if (TextUtils.equals("CID", c0682Mc.i)) {
this.sourceDetail.setAvatar(C6583cXR.VS_(getContext(), R.drawable.icon_prompt_pay_cid).toString());
}
this.sourceDetail.tvSourceAccount.setVisibility(8);
this.sourceDetail.setSourceName(C6583cXR.c(c0682Mc.i, c0682Mc.g));
}
@Override // o.InterfaceC8932daF.IeS
public final void c(C0682Mc c0682Mc) {
this.targetDetail.setText(getString(R.string.billers_detail));
if (c0682Mc.a != null && !Uri.EMPTY.toString().equals(c0682Mc.a)) {
this.targetDetail.setBillerAvatar(c0682Mc.a);
} else {
this.targetDetail.setAvatar(C6583cXR.VS_(getContext(), R.drawable.biller_place_holder).toString());
}
this.targetDetail.setTargetName(c0682Mc.f);
this.targetDetail.setReferenceNumbers(c0682Mc.b);
this.targetDetail.setReferenceNo1(c0682Mc.n);
if (c0682Mc.t != null && !c0682Mc.t.isEmpty()) {
this.targetDetail.setReferenceNo2(c0682Mc.l);
}
if (c0682Mc.r == null || c0682Mc.r.isEmpty()) {
return;
}
this.targetDetail.setReferenceNo3(c0682Mc.q);
}
@Override // o.InterfaceC8932daF.IeS
public final void a(C0682Mc c0682Mc) {
this.status.setVisibility(0);
this.status.setText(getString(R.string.rtpb_subscription_status));
this.status.setSourceName(c0682Mc.h);
if (EnumC12253eui.REJECT.status.equals(c0682Mc.j)) {
this.status.setAccountNumber(getString(R.string.rtpb_subscription_disclaimer));
} else {
this.status.tvSourceAccount.setVisibility(8);
}
}
@Override // o.InterfaceC8932daF.IeS
public final void b() {
Intent intent = new Intent(getContext(), (Class<?>) EBillSubscriptionActivity.class);
intent.addFlags(603979776);
startActivityForResult(intent, 6022);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
EBillSubscriptionActivity eBillSubscriptionActivity;
C4652beH c4652beH;
super.onActivityResult(i, i2, intent);
if (i == 6022 && (getActivity() instanceof EBillSubscriptionActivity) && (c4652beH = (eBillSubscriptionActivity = (EBillSubscriptionActivity) getActivity()).eBillSubscriptionPresenter) != null) {
c4652beH.b();
eBillSubscriptionActivity.eBillSubscriptionPresenter.a();
}
}
@OnClick
public void onUnsubscribeClick() {
CustomDialog b = CustomDialog.b(getContext());
String string = getString(R.string.unsubcribe_title);
if (gjJ.a(string)) {
b.mTitleTextView.setVisibility(0);
b.mTitleTextView.setText(string);
}
String string2 = getString(R.string.unsubcribe_content);
if (gjJ.a(string2)) {
b.mTextTextView.setVisibility(0);
b.mTextTextView.setText(string2);
}
((CustomDialog) CustomDialog.e(new Object[]{b.aoT_(R.string.unsubcribe_yes, new DialogInterface.OnClickListener(this) { // from class: o.eXX
private EBillSubscriptionDetailFragment c;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
EBillSubscriptionDetailFragment.a(this.c);
}
{
this.c = this;
}
}), Integer.valueOf(R.string.unsubcribe_no), new DialogInterface.OnClickListener() { // from class: o.eXV
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}})).show();
}
public static /* synthetic */ void a(EBillSubscriptionDetailFragment eBillSubscriptionDetailFragment) {
C4694bex c4694bex = eBillSubscriptionDetailFragment.eBillSubscriptionDetailPresenter;
C0682Mc c0682Mc = eBillSubscriptionDetailFragment.c;
if (c4694bex.a) {
return;
}
c4694bex.a = true;
if (c4694bex.f != 0) {
c4694bex.f.y();
}
C15316gnF b = C15316gnF.b();
b.d = c0682Mc.c;
b.c = c0682Mc.p;
b.b = c0682Mc.t;
b.i = c0682Mc.r;
b.a = c0682Mc.i;
b.e = c0682Mc.g;
c4694bex.d.d(b);
IaV iaV = c4694bex.d;
iaV.d(iaV.i, new C4694bex.HBt(c4694bex, (byte) 0));
}
@Override // o.InterfaceC8932daF.IeS
public final void b(C0693Mj c0693Mj) {
String str = c0693Mj.c;
EnumC8951daY enumC8951daY = EnumC8951daY.ERROR;
FragmentActivity activity = getActivity();
if (activity == null || getActivity() == null) {
return;
}
BaseActivity.a(new Object[]{(BaseActivity) getActivity(), activity, Integer.valueOf(R.id.view_container), str, enumC8951daY}, 855668825, -855668822, R.id.view_container);
}
}