what-the-bank/sources/com/scb/phone/view/fragment/ccrredemption/pointtopay/PointToPayReviewFragment.java

439 lines
16 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.ccrredemption.pointtopay;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.huawei.hms.support.api.entity.common.CommonConstant;
import com.scb.phone.R;
import com.scb.phone.view.activity.cardmanagement.CreditCardTermsAndConditionsActivity;
import com.scb.phone.view.activity.ccrredemption.pointtopay.PointToPaySuccessfulActivity;
import com.scb.phone.view.custom.cardmanagement.TermsAndConditionsView;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.custom.transferandpay.CustomNoteItem;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPayItem;
import com.scb.phone.view.custom.transferandpay.CustomTransferAndPaySource;
import com.scb.phone.view.fragment.BaseFragment;
import com.scb.phone.view.fragment.ccrredemption.pointtopay.PointToPayReviewFragment;
import java.util.ArrayList;
import o.C0367Fb;
import o.C0493Hw;
import o.C0693Mj;
import o.C14957gcv;
import o.C3225atW;
import o.EnumC1255Za;
import o.HD;
import o.InterfaceC10303eAL;
import o.InterfaceC13391fZD;
import o.InterfaceC9046dcN;
import o.ZI;
import o.eAO;
import o.gjJ;
import o.guQ;
/* loaded from: classes5.dex */
public final class PointToPayReviewFragment extends Hilt_PointToPayReviewFragment implements InterfaceC9046dcN.LWm, InterfaceC10303eAL, eAO {
public static final Sts d = new Sts(0);
private C0367Fb c;
@BindView
public TextView cashBackDay;
@BindView
public Button confirmButton;
@BindView
public CustomTransferAndPaySource customCard;
@BindView
public CustomTransferAndPayItem customCashBack;
@BindView
public CustomTransferAndPayItem customCashBackPercentage;
@BindView
public CustomTransferAndPayItem customPointRedeemed;
@BindView
public CustomNoteItem customTransaction;
private String g = "";
private HD h;
private ArrayList<C0367Fb> i;
private String j;
@InterfaceC13391fZD
public C3225atW presenter;
@BindView
public TermsAndConditionsView termsAndConditions;
/* loaded from: classes5.dex */
public static final class Sts {
private Sts() {
}
public /* synthetic */ Sts(byte b) {
this();
}
}
@Override // androidx.fragment.app.Fragment
public final void onCreate(Bundle bundle) {
super.onCreate(bundle);
v("point2pay_review");
Bundle arguments = getArguments();
if (arguments != null) {
this.c = (C0367Fb) arguments.getParcelable("EXTRA_CREDIT_CARD_DISPLAY_KEY");
this.i = arguments.getParcelableArrayList("EXTRA_CREDIT_CARD_DISPLAY_LIST_KEY");
this.h = (HD) arguments.getParcelable("EXTRA_TRANSACTION_DATA_DISPLAY_KEY");
this.j = arguments.getString("EXTRA_DEEP_LINK_CHANNEL_KEY");
String string = arguments.getString("EXTRA_TERM_AND_CONDITION_URL");
if (string == null) {
string = "";
}
this.g = string;
}
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
View inflate = layoutInflater.inflate(R.layout.2131559815, viewGroup, false);
((BaseFragment) this).a = ButterKnife.c(this, inflate);
return inflate;
}
@Override // androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
C14957gcv.e(view, "");
super.onViewCreated(view, bundle);
C3225atW c3225atW = this.presenter;
final C3225atW c3225atW2 = null;
if (c3225atW == null) {
C14957gcv.a("");
c3225atW = null;
}
c3225atW.e((C3225atW) this);
C3225atW c3225atW3 = this.presenter;
if (c3225atW3 == null) {
C14957gcv.a("");
c3225atW3 = null;
}
C0367Fb c0367Fb = this.c;
ArrayList<C0367Fb> arrayList = this.i;
HD hd = this.h;
c3225atW3.e = c0367Fb;
c3225atW3.b = arrayList;
c3225atW3.d = hd;
C3225atW c3225atW4 = this.presenter;
if (c3225atW4 != null) {
c3225atW2 = c3225atW4;
} else {
C14957gcv.a("");
}
ZI.IeS ieS = new ZI.IeS(c3225atW2) { // from class: o.atX
private C3225atW b;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3225atW.d(this.b, (InterfaceC9046dcN.LWm) obj);
}
{
this.b = c3225atW2;
}
};
if (c3225atW2.f != 0) {
ieS.e(c3225atW2.f);
}
}
@Override // o.InterfaceC9046dcN.LWm
public final void c(String str, String str2) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
CustomTransferAndPaySource customTransferAndPaySource = this.customCard;
if (customTransferAndPaySource == null) {
C14957gcv.a("");
customTransferAndPaySource = null;
}
customTransferAndPaySource.setText(getString(R.string.auto_p2p_review_card_title));
customTransferAndPaySource.setSourceName(str);
customTransferAndPaySource.setAccountNumber(str2);
customTransferAndPaySource.b();
customTransferAndPaySource.setDivider(true);
customTransferAndPaySource.setDividerLeftPadding((int) customTransferAndPaySource.getResources().getDimension(R.dimen.f16672131165433));
}
@Override // o.InterfaceC9046dcN.LWm
public final void e(String str) {
C14957gcv.e(str, "");
CustomNoteItem customNoteItem = this.customTransaction;
if (customNoteItem == null) {
C14957gcv.a("");
customNoteItem = null;
}
customNoteItem.setTitle(getString(R.string.auto_p2p_review_description_title));
customNoteItem.setText(str);
customNoteItem.divider.setVisibility(0);
customNoteItem.setFullDivider(false);
customNoteItem.topSpace.setVisibility(0);
customNoteItem.bottomSpace.setVisibility(0);
}
@Override // o.InterfaceC9046dcN.LWm
public final void c(String str) {
C14957gcv.e(str, "");
CustomTransferAndPayItem customTransferAndPayItem = this.customPointRedeemed;
if (customTransferAndPayItem == null) {
C14957gcv.a("");
customTransferAndPayItem = null;
}
customTransferAndPayItem.setText(getString(R.string.auto_p2p_review_point_redeemed_title));
customTransferAndPayItem.setValue(str);
customTransferAndPayItem.mDividerView.setVisibility(0);
customTransferAndPayItem.setFullDivider(false);
customTransferAndPayItem.mTopSpace.setVisibility(0);
customTransferAndPayItem.mBottomSpace.setVisibility(0);
}
@Override // o.InterfaceC9046dcN.LWm
public final void b(String str) {
C14957gcv.e(str, "");
CustomTransferAndPayItem customTransferAndPayItem = this.customCashBackPercentage;
if (customTransferAndPayItem == null) {
C14957gcv.a("");
customTransferAndPayItem = null;
}
customTransferAndPayItem.setText(getString(R.string.auto_p2p_review_cashback_percentage_title));
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append("%");
customTransferAndPayItem.setValue(sb.toString());
customTransferAndPayItem.mDividerView.setVisibility(0);
customTransferAndPayItem.setFullDivider(false);
customTransferAndPayItem.mTopSpace.setVisibility(0);
customTransferAndPayItem.mBottomSpace.setVisibility(0);
}
@Override // o.InterfaceC9046dcN.LWm
public final void d(String str) {
C14957gcv.e(str, "");
CustomTransferAndPayItem customTransferAndPayItem = this.customCashBack;
if (customTransferAndPayItem == null) {
C14957gcv.a("");
customTransferAndPayItem = null;
}
customTransferAndPayItem.setText(getString(R.string.auto_p2p_review_total_cashback_title));
customTransferAndPayItem.setValue(str);
customTransferAndPayItem.mDividerView.setVisibility(0);
customTransferAndPayItem.setFullDivider(true);
customTransferAndPayItem.mTopSpace.setVisibility(0);
customTransferAndPayItem.mBottomSpace.setVisibility(0);
}
@Override // o.InterfaceC9046dcN.LWm
public final void c() {
TextView textView = this.cashBackDay;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(getString(R.string.auto_p2p_review_warning_title));
}
@Override // o.InterfaceC9046dcN.LWm
public final void b() {
TermsAndConditionsView termsAndConditionsView = this.termsAndConditions;
TermsAndConditionsView termsAndConditionsView2 = null;
if (termsAndConditionsView == null) {
C14957gcv.a("");
termsAndConditionsView = null;
}
termsAndConditionsView.setTermsAndConditionsListener(this);
TermsAndConditionsView termsAndConditionsView3 = this.termsAndConditions;
if (termsAndConditionsView3 != null) {
termsAndConditionsView2 = termsAndConditionsView3;
} else {
C14957gcv.a("");
}
termsAndConditionsView2.setTermsCheckboxListener(this);
}
@Override // o.InterfaceC10303eAL
public final void j() {
Context context = getContext();
if (context != null) {
CreditCardTermsAndConditionsActivity.LWm lWm = CreditCardTermsAndConditionsActivity.b;
String str = this.g;
C14957gcv.e(context, "");
Intent putExtra = new Intent(context, (Class<?>) CreditCardTermsAndConditionsActivity.class).putExtra("EXTRA_URL_TERM_AND_CONDITIONS", str);
C14957gcv.c(putExtra, "");
context.startActivity(putExtra);
}
}
@Override // o.eAO
public final void c(boolean z) {
Button button = this.confirmButton;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(z);
}
@Override // o.InterfaceC9046dcN.LWm
public final void a() {
CustomTransferAndPayItem customTransferAndPayItem = this.customCashBackPercentage;
if (customTransferAndPayItem == null) {
C14957gcv.a("");
customTransferAndPayItem = null;
}
customTransferAndPayItem.setVisibility(8);
}
@Override // o.InterfaceC9046dcN.LWm
public final void d(C0493Hw c0493Hw, HD hd, String str) {
C14957gcv.e(c0493Hw, "");
C14957gcv.e(hd, "");
C14957gcv.e(str, "");
FragmentActivity activity = getActivity();
if (activity != null) {
PointToPaySuccessfulActivity.HBt hBt = PointToPaySuccessfulActivity.b;
FragmentActivity fragmentActivity = activity;
String str2 = c0493Hw.b;
String str3 = this.j;
C14957gcv.e(fragmentActivity, "");
C14957gcv.e(str2, "");
C14957gcv.e(str, "");
Intent intent = new Intent(fragmentActivity, (Class<?>) PointToPaySuccessfulActivity.class);
intent.putExtra("EXTRA_SLIP_REF_ID_KEY", str2);
intent.putExtra("EXTRA_CREDIT_CARD_REF_KEY", str);
intent.putExtra("EXTRA_DEEP_LINK_CHANNEL_KEY", str3);
activity.startActivity(intent);
}
}
@Override // o.InterfaceC9046dcN.LWm
public final void d() {
CustomTransferAndPayItem customTransferAndPayItem = this.customCashBack;
if (customTransferAndPayItem == null) {
C14957gcv.a("");
customTransferAndPayItem = null;
}
customTransferAndPayItem.setFullDivider(true);
}
@Override // com.scb.phone.view.fragment.BaseFragment, o.InterfaceC6638cYp
public final void e(C0693Mj c0693Mj) {
C14957gcv.e(c0693Mj, "");
CustomDialog b = CustomDialog.b(getActivity());
String str = c0693Mj.d;
if (gjJ.a(str)) {
b.mTitleTextView.setVisibility(0);
b.mTitleTextView.setText(str);
}
String str2 = c0693Mj.c;
if (gjJ.a(str2)) {
b.mTextTextView.setVisibility(0);
b.mTextTextView.setText(str2);
}
b.setCancelable(false);
b.aoT_(R.string.ok, new DialogInterface.OnClickListener(this) { // from class: o.eLn
private PointToPayReviewFragment b;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
PointToPayReviewFragment.a(this.b);
}
{
this.b = this;
}
}).show();
}
@OnClick
public final void onNextClick() {
final C3225atW c3225atW = this.presenter;
if (c3225atW == null) {
C14957gcv.a("");
c3225atW = null;
}
ZI.IeS ieS = new ZI.IeS(c3225atW) { // from class: o.atZ
private C3225atW d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3225atW.c(this.d, (InterfaceC9046dcN.LWm) obj);
}
{
this.d = c3225atW;
}
};
if (c3225atW.f != 0) {
ieS.e(c3225atW.f);
}
}
public static /* synthetic */ void a(PointToPayReviewFragment pointToPayReviewFragment) {
C14957gcv.e(pointToPayReviewFragment, "");
try {
Intent intent = new Intent(CommonConstant.ACTION.HWID_SCHEME_URL, Uri.parse("scbeasy://creditcards/point"));
intent.putExtra("NOTIFICATION_INBOX_TAG", C14957gcv.b((Object) pointToPayReviewFragment.j, (Object) EnumC1255Za.INBOX_NOTIFICATION.name()));
C0367Fb c0367Fb = pointToPayReviewFragment.c;
intent.putExtra("EXTRA_CREDIT_CARD_REF_KEY", c0367Fb != null ? c0367Fb.g : null);
pointToPayReviewFragment.startActivity(intent);
FragmentActivity activity = pointToPayReviewFragment.getActivity();
if (activity != null) {
activity.finish();
}
} catch (ActivityNotFoundException e) {
guQ.e(e);
} catch (NullPointerException e2) {
guQ.e(e2);
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroyView() {
TermsAndConditionsView termsAndConditionsView = this.termsAndConditions;
C3225atW c3225atW = null;
if (termsAndConditionsView == null) {
C14957gcv.a("");
termsAndConditionsView = null;
}
termsAndConditionsView.setTermsAndConditionsListener(null);
TermsAndConditionsView termsAndConditionsView2 = this.termsAndConditions;
if (termsAndConditionsView2 == null) {
C14957gcv.a("");
termsAndConditionsView2 = null;
}
termsAndConditionsView2.setTermsCheckboxListener(null);
this.c = null;
this.i = null;
this.h = null;
C3225atW c3225atW2 = this.presenter;
if (c3225atW2 != null) {
c3225atW = c3225atW2;
} else {
C14957gcv.a("");
}
c3225atW.w_();
super.onDestroyView();
}
}