package com.scb.phone.view.fragment.ccrredemption.ecoupon; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import androidx.fragment.app.FragmentActivity; import butterknife.BindView; import butterknife.OnClick; import com.scb.phone.R; import com.scb.phone.view.activity.ccrredemption.ecoupon.ECouponRedemptionDetailActivity; import com.scb.phone.view.activity.ccrredemption.ecoupon.MyECouponActivity; import com.scb.phone.view.activity.creditcard.CreditCardDetailActivity; import com.scb.phone.view.custom.ccrredemption.ecoupon.CustomECouponFooterButtonViewComponent; import com.scb.phone.view.fragment.ccrredemption.ecoupon.ECouponSaveSlipFragment; import java.util.Collections; import java.util.List; import o.C14881gav; import o.C14957gcv; import o.C3197asv; import o.EW; import o.InterfaceC13391fZD; import o.InterfaceC9040dcH; import o.QI; import o.ZI; /* loaded from: classes5.dex */ public final class ECouponSaveSlipFragment extends Hilt_ECouponSaveSlipFragment implements InterfaceC9040dcH.tOB { public static final IeS d = new IeS(0); @BindView public LinearLayout deepLinkButtonsContainer; private String f; private int g; private String h; private String i; private boolean j; private String k; /* renamed from: o, reason: collision with root package name */ private EW f8027o; @InterfaceC13391fZD public C3197asv saveSlipPresenter; /* loaded from: classes5.dex */ public static final class IeS { private IeS() { } public /* synthetic */ IeS(byte b) { this(); } } @Override // androidx.fragment.app.Fragment public final void onCreate(Bundle bundle) { String string; String string2; String string3; super.onCreate(bundle); Bundle arguments = getArguments(); if (arguments != null) { String str = ""; C14957gcv.e("EXTRA_CARD_REF_NO_KEY", ""); if (arguments == null) { string = ""; } else { string = arguments.getString("EXTRA_CARD_REF_NO_KEY", ""); C14957gcv.c((Object) string, ""); } this.h = string; C14957gcv.e("EXTRA_REF_ID_KEY", ""); if (arguments == null) { string2 = ""; } else { string2 = arguments.getString("EXTRA_REF_ID_KEY", ""); C14957gcv.c((Object) string2, ""); } this.f = string2; C14957gcv.e("EXTRA_ITEM_CODE_KEY", ""); if (arguments == null) { string3 = ""; } else { string3 = arguments.getString("EXTRA_ITEM_CODE_KEY", ""); C14957gcv.c((Object) string3, ""); } this.i = string3; C14957gcv.e("EXTRA_SLIP_REF_ID_KEY", ""); if (arguments != null) { String string4 = arguments.getString("EXTRA_SLIP_REF_ID_KEY", ""); C14957gcv.c((Object) string4, ""); str = string4; } this.k = str; this.j = arguments.getBoolean("EXTRA_IS_COUPON_SENSITIVE_TIME_KEY"); this.g = arguments.getInt("EXTRA_RELATION_ID_KEY"); } } @Override // com.scb.phone.view.fragment.PurchaseSuccessFragment, androidx.fragment.app.Fragment public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) { C14957gcv.e(layoutInflater, ""); C3197asv c3197asv = this.saveSlipPresenter; if (c3197asv == null) { C14957gcv.a(""); c3197asv = null; } c3197asv.e((C3197asv) this); l(); return super.onCreateView(layoutInflater, viewGroup, bundle); } @Override // androidx.fragment.app.Fragment public final void onViewCreated(View view, Bundle bundle) { C14957gcv.e(view, ""); super.onViewCreated(view, bundle); String string = getString(R.string.empty); C14957gcv.c((Object) string, ""); C14957gcv.e(string, ""); TextView textView = this.buttonReturn; textView.setText(string); textView.setGravity(17); final C3197asv c3197asv = this.saveSlipPresenter; C3197asv c3197asv2 = null; if (c3197asv == null) { C14957gcv.a(""); c3197asv = null; } boolean z = this.j; final String str = this.k; if (str == null) { C14957gcv.a(""); str = null; } C14957gcv.e(str, ""); c3197asv.a = z; ZI.IeS ieS = new ZI.IeS(c3197asv, str) { // from class: o.ass private C3197asv d; private String e; @Override // o.ZI.IeS public final void e(Object obj) { C3197asv.d(this.d, this.e, (InterfaceC9040dcH.tOB) obj); } { this.d = c3197asv; this.e = str; } }; if (c3197asv.f != 0) { ieS.e(c3197asv.f); } C3197asv c3197asv3 = this.saveSlipPresenter; if (c3197asv3 != null) { c3197asv2 = c3197asv3; } else { C14957gcv.a(""); } ZI.IeS ieS2 = new ZI.IeS() { // from class: o.asw @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9040dcH.tOB) obj).n(); } }; if (c3197asv2.f != 0) { ieS2.e(c3197asv2.f); } } @Override // o.InterfaceC9040dcH.tOB public final void n() { v("ecoupon_successful"); } @Override // com.scb.phone.view.fragment.PurchaseSuccessFragment, o.cYH public final void d(EW ew) { this.f8027o = ew; this.presenter.e(ew, (List) null); } @OnClick public final void onClickReturnButton() { C3197asv c3197asv = this.saveSlipPresenter; if (c3197asv == null) { C14957gcv.a(""); c3197asv = null; } ZI.IeS ieS = new ZI.IeS() { // from class: o.asB @Override // o.ZI.IeS public final void e(Object obj) { ((InterfaceC9040dcH.tOB) obj).f(); } }; if (c3197asv.f != 0) { ieS.e(c3197asv.f); } } @Override // com.scb.phone.view.fragment.PurchaseSuccessFragment, o.cYH public final void c(List list) { List list2 = list; if (list2 == null || list2.isEmpty()) { return; } LinearLayout linearLayout = this.deepLinkButtonsContainer; if (linearLayout == null) { C14957gcv.a(""); linearLayout = null; } linearLayout.removeAllViews(); Context context = linearLayout.getContext(); C14957gcv.c(context, ""); CustomECouponFooterButtonViewComponent customECouponFooterButtonViewComponent = new CustomECouponFooterButtonViewComponent(context, null, 0); customECouponFooterButtonViewComponent.setName(((QI) C14881gav.e((List) list)).b); customECouponFooterButtonViewComponent.setButtonClickListener(new View.OnClickListener(this) { // from class: o.eKK private ECouponSaveSlipFragment c; @Override // android.view.View.OnClickListener public final void onClick(View view) { ECouponSaveSlipFragment.c(this.c); } { this.c = this; } }); linearLayout.addView(customECouponFooterButtonViewComponent); linearLayout.setVisibility(0); } @Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment public final void onDestroyView() { C3197asv c3197asv = this.saveSlipPresenter; if (c3197asv == null) { C14957gcv.a(""); c3197asv = null; } c3197asv.w_(); this.presenter.w_(); super.onDestroyView(); } @Override // o.InterfaceC9040dcH.tOB public final void i() { Context context = getContext(); if (context != null) { MyECouponActivity.HBt hBt = MyECouponActivity.b; String str = this.h; if (str == null) { C14957gcv.a(""); str = null; } context.startActivity(MyECouponActivity.HBt.ZN_(context, str, false)); } } @Override // o.InterfaceC9040dcH.tOB public final void g() { String str; String str2; String str3; Context context = getContext(); if (context != null) { ECouponRedemptionDetailActivity.HBt hBt = ECouponRedemptionDetailActivity.b; String str4 = this.h; if (str4 == null) { C14957gcv.a(""); str = null; } else { str = str4; } String str5 = this.f; if (str5 == null) { C14957gcv.a(""); str2 = null; } else { str2 = str5; } String str6 = this.i; if (str6 == null) { C14957gcv.a(""); str3 = null; } else { str3 = str6; } context.startActivity(ECouponRedemptionDetailActivity.HBt.ZL_(context, str, str2, str3, this.g, false)); } } @Override // o.InterfaceC9040dcH.tOB public final void f() { Intent intent = new Intent(getActivity(), (Class) CreditCardDetailActivity.class); intent.setFlags(603979776); FragmentActivity activity = getActivity(); if (activity != null) { activity.finish(); } startActivity(intent); } @Override // o.InterfaceC9040dcH.tOB public final void k() { String string = getString(R.string.return_to_credit_card); C14957gcv.c((Object) string, ""); C14957gcv.e(string, ""); TextView textView = this.buttonReturn; textView.setText(string); textView.setGravity(17); String string2 = getString(R.string.e_coupon_view_my_e_coupon); C14957gcv.c((Object) string2, ""); List singletonList = Collections.singletonList(new QI(string2, "")); C14957gcv.c(singletonList, ""); c(singletonList); } public static /* synthetic */ void c(ECouponSaveSlipFragment eCouponSaveSlipFragment) { C14957gcv.e(eCouponSaveSlipFragment, ""); final C3197asv c3197asv = eCouponSaveSlipFragment.saveSlipPresenter; if (c3197asv == null) { C14957gcv.a(""); c3197asv = null; } ZI.IeS ieS = new ZI.IeS(c3197asv) { // from class: o.asz private C3197asv d; @Override // o.ZI.IeS public final void e(Object obj) { C3197asv.a(this.d, (InterfaceC9040dcH.tOB) obj); } { this.d = c3197asv; } }; if (c3197asv.f != 0) { ieS.e(c3197asv.f); } } }