package com.scb.phone.view.fragment.ccrredemption.review; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnCheckedChanged; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.cardmanagement.CreditCardTermsAndConditionsActivity; import com.scb.phone.view.activity.ccrredemption.categories.RewardsHomeActivity; import com.scb.phone.view.activity.ccrredemption.confirm.ConfirmRedemptionActivity; import com.scb.phone.view.custom.cardmanagement.TermsAndConditionsView; import o.C0461Hb; import o.C0477Hl; import o.C3324avR; import o.InterfaceC10303eAL; import o.InterfaceC13391fZD; import o.InterfaceC9058dcZ; import o.ZI; import o.eAO; /* loaded from: classes5.dex */ public class ReviewRedemptionFragment extends Hilt_ReviewRedemptionFragment implements InterfaceC9058dcZ, InterfaceC10303eAL, eAO { @BindView Button btnConfirm; @BindView TextView cashRewardsEta; private C0477Hl d; @BindView TextView deliveryEta; @BindView ImageView ivLogo; @BindView ConstraintLayout layoutEffectiveDate; @BindView TextView oprUserReviewConsent; @InterfaceC13391fZD public C3324avR reviewRedemptionPresenter; @BindView TermsAndConditionsView termsAndConditionsView; @BindView ConstraintLayout totalPayableSection; @BindView TextView txvCardNo; @BindView TextView txvCardType; @BindView TextView txvCurrency; @BindView TextView txvEffectiveDate; @BindView TextView txvItemDescription; @BindView TextView txvItemName; @BindView TextView txvPoints; @BindView TextView txvTotalPayable; @BindView TextView txvTotalPoints; @Override // androidx.fragment.app.Fragment public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { View inflate = layoutInflater.inflate(R.layout.2131559881, viewGroup, false); ButterKnife.c(this, inflate); C0477Hl c0477Hl = (C0477Hl) getActivity().getIntent().getParcelableExtra("com.scb.phone.presentation.view.activity.ccr_redemption.review.ReviewRedemptionActivity.REVIEW_DTO_EXTRA"); this.d = c0477Hl; this.reviewRedemptionPresenter.d = c0477Hl; this.reviewRedemptionPresenter.e((C3324avR) this); this.ivLogo.setVisibility(8); this.txvCardType.setText(this.d.b); this.txvCardNo.setText(this.d.s); this.txvItemName.setText(this.d.r); this.txvItemDescription.setText(this.d.h); this.txvTotalPoints.setText(this.d.j); C3324avR c3324avR = this.reviewRedemptionPresenter; final int parseInt = Integer.parseInt(this.d.j.replace(",", "")); ZI.IeS ieS = new ZI.IeS(parseInt) { // from class: o.avV private int b; @Override // o.ZI.IeS public final void e(Object obj) { C3324avR.e(this.b, (InterfaceC9058dcZ) obj); } { this.b = parseInt; } }; if (c3324avR.f != 0) { ieS.e(c3324avR.f); } if (!this.d.k) { this.totalPayableSection.setVisibility(0); this.txvTotalPayable.setText(this.d.i); this.txvCurrency.setText(this.d.g); } else { this.totalPayableSection.setVisibility(8); } this.termsAndConditionsView.setTermsAndConditionsListener(this); this.termsAndConditionsView.setTermsCheckboxListener(this); this.btnConfirm.setEnabled(false); if (this.d.l) { this.deliveryEta.setText(getResources().getString(R.string.voucher_delivery_eta)); this.cashRewardsEta.setText(getResources().getString(R.string.cash_rewards_eta_opr)); } else { this.deliveryEta.setText(getResources().getString(R.string.item_delivery_eta)); this.cashRewardsEta.setText(getResources().getString(R.string.cash_rewards_eta)); } if (this.d.m) { this.layoutEffectiveDate.setVisibility(0); this.txvEffectiveDate.setText(this.d.f); this.cashRewardsEta.setVisibility(8); this.deliveryEta.setVisibility(8); this.oprUserReviewConsent.setVisibility(0); this.txvItemDescription.setVisibility(8); } else { this.layoutEffectiveDate.setVisibility(8); this.cashRewardsEta.setVisibility(0); this.deliveryEta.setVisibility(0); this.oprUserReviewConsent.setVisibility(8); } return inflate; } @OnCheckedChanged public void onTermsAndConditionsCheckChanged(boolean z) { this.btnConfirm.setEnabled(z); } /* JADX INFO: Access modifiers changed from: package-private */ @OnClick public void onConfirmRedemptionClick() { this.reviewRedemptionPresenter.c(); } @Override // o.InterfaceC9058dcZ public final void a(C0461Hb c0461Hb) { if (((Boolean) RewardsHomeActivity.d(new Object[0])).booleanValue()) { Intent intent = new Intent(getActivity(), (Class) RewardsHomeActivity.class); intent.addFlags(603979776); intent.putExtra("com.scb.phone.presentation.view.activity.ccr_redemption.confirm.ConfirmRedemptionActivity.CARD_POINTS_BALANCE", c0461Hb.r); startActivity(intent); } startActivityForResult(ConfirmRedemptionActivity.ZI_(getContext(), c0461Hb), 104); } @Override // o.InterfaceC9058dcZ public final void h() { if (getActivity() != null) { startActivity(CreditCardTermsAndConditionsActivity.Zc_(getActivity(), this.d.y)); } } @Override // o.InterfaceC9058dcZ public final void i() { if (getActivity() != null) { startActivity(CreditCardTermsAndConditionsActivity.Zb_(getActivity(), "CREDITCARDREWARDS_ONEPOINT")); } } @Override // o.InterfaceC9058dcZ public final void g() { this.txvPoints.setText(getResources().getString(R.string.point_label)); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onActivityResult(int i, int i2, Intent intent) { if (i == 104 && intent != null) { getActivity().setResult(-1, intent); getActivity().finish(); } super.onActivityResult(i, i2, intent); } @Override // o.eAO public final void c(boolean z) { this.btnConfirm.setEnabled(z); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public void onDestroy() { this.reviewRedemptionPresenter.w_(); super.onDestroy(); } @Override // o.InterfaceC10303eAL public final void j() { C3324avR c3324avR = this.reviewRedemptionPresenter; final boolean z = this.d.m; final boolean z2 = this.d.l; ZI.IeS ieS = new ZI.IeS(z2, z) { // from class: o.avT private boolean b; private boolean c; @Override // o.ZI.IeS public final void e(Object obj) { C3324avR.e(this.c, this.b, (InterfaceC9058dcZ) obj); } { this.c = z2; this.b = z; } }; if (c3324avR.f != 0) { ieS.e(c3324avR.f); } } }