what-the-bank/sources/com/scb/phone/view/fragment/ccrredemption/ecoupon/ECouponDetailFragment.java

659 lines
19 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
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.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.ccrredemption.ecoupon.ECouponCommonActivity;
import java.text.NumberFormat;
import java.util.Locale;
import o.C0367Fb;
import o.C0463Hc;
import o.C0489Ht;
import o.C0491Hv;
import o.C12891fKc;
import o.C14957gcv;
import o.C16316nR;
import o.C3109arM;
import o.C6583cXR;
import o.EnumC3162asM;
import o.InterfaceC13391fZD;
import o.InterfaceC9040dcH;
import o.ZI;
import o.gdZ;
import o.nMh;
/* loaded from: classes5.dex */
public final class ECouponDetailFragment extends Hilt_ECouponDetailFragment implements InterfaceC9040dcH.Sts {
public static final IeS c = new IeS(0);
@BindView
public Button btnNext;
@BindView
public LinearLayout conditionLayout;
private C0367Fb d;
private String g;
@BindView
public ImageView imageCover;
private C0463Hc j;
@InterfaceC13391fZD
public C3109arM presenter;
@BindView
public TextView txvAvailability;
@BindView
public TextView txvCondition;
@BindView
public TextView txvDescription;
@BindView
public TextView txvName;
@BindView
public TextView txvPoint;
@BindView
public TextView txvPointWarning;
@BindView
public TextView txvValidityDate;
@BindView
public TextView txvWarningTime;
@BindView
public LinearLayout warningTimeSection;
/* loaded from: classes5.dex */
public static final class IeS {
private IeS() {
}
public /* synthetic */ IeS(byte b) {
this();
}
}
@Override // androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
return layoutInflater.inflate(R.layout.2131559581, viewGroup, false);
}
@Override // androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
C14957gcv.e(view, "");
super.onViewCreated(view, bundle);
ButterKnife.c(this, view);
final C3109arM c3109arM = this.presenter;
String str = null;
if (c3109arM == null) {
C14957gcv.a("");
c3109arM = null;
}
c3109arM.e((C3109arM) this);
String str2 = this.g;
if (str2 == null) {
C14957gcv.a("");
str2 = null;
}
C0463Hc c0463Hc = this.j;
if (c0463Hc == null) {
C14957gcv.a("");
c0463Hc = null;
}
C14957gcv.e(str2, "");
C14957gcv.e(c0463Hc, "");
c3109arM.d = str2;
c3109arM.e = c0463Hc;
ZI.IeS ieS = new ZI.IeS() { // from class: o.arX
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9040dcH.Sts) obj).b();
}
};
if (c3109arM.f != 0) {
ieS.e(c3109arM.f);
}
final C0463Hc c0463Hc2 = c3109arM.e;
if (c0463Hc2 == null) {
C14957gcv.a("");
c0463Hc2 = null;
}
ZI.IeS ieS2 = new ZI.IeS(c0463Hc2) { // from class: o.asa
private C0463Hc a;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.b(this.a, (InterfaceC9040dcH.Sts) obj);
}
{
this.a = c0463Hc2;
}
};
if (c3109arM.f != 0) {
ieS2.e(c3109arM.f);
}
ZI.IeS ieS3 = new ZI.IeS(c0463Hc2) { // from class: o.arU
private C0463Hc e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.e(this.e, (InterfaceC9040dcH.Sts) obj);
}
{
this.e = c0463Hc2;
}
};
if (c3109arM.f != 0) {
ieS3.e(c3109arM.f);
}
ZI.IeS ieS4 = new ZI.IeS(c0463Hc2) { // from class: o.arW
private C0463Hc c;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.d(this.c, (InterfaceC9040dcH.Sts) obj);
}
{
this.c = c0463Hc2;
}
};
if (c3109arM.f != 0) {
ieS4.e(c3109arM.f);
}
ZI.IeS ieS5 = new ZI.IeS(c0463Hc2) { // from class: o.arO
private C0463Hc d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.j(this.d, (InterfaceC9040dcH.Sts) obj);
}
{
this.d = c0463Hc2;
}
};
if (c3109arM.f != 0) {
ieS5.e(c3109arM.f);
}
ZI.IeS ieS6 = new ZI.IeS(c0463Hc2) { // from class: o.arT
private C0463Hc e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.c(this.e, (InterfaceC9040dcH.Sts) obj);
}
{
this.e = c0463Hc2;
}
};
if (c3109arM.f != 0) {
ieS6.e(c3109arM.f);
}
boolean z = c0463Hc2.g && !c0463Hc2.j;
ZI.IeS ieS7 = new ZI.IeS() { // from class: o.arV
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9040dcH.Sts) obj).d();
}
};
if (z && c3109arM.f != 0) {
ieS7.e(c3109arM.f);
}
ZI.IeS ieS8 = new ZI.IeS(c0463Hc2) { // from class: o.arS
private C0463Hc b;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.g(this.b, (InterfaceC9040dcH.Sts) obj);
}
{
this.b = c0463Hc2;
}
};
if (c3109arM.f != 0) {
ieS8.e(c3109arM.f);
}
String str3 = c3109arM.d;
if (str3 == null) {
C14957gcv.a("");
} else {
str = str3;
}
final int intValue = C6583cXR.E(str).intValue();
final Integer num = c0463Hc2.q;
C14957gcv.c(num, "");
boolean z2 = intValue < num.intValue();
ZI.IeS ieS9 = new ZI.IeS(c3109arM, num, intValue) { // from class: o.arP
private int a;
private C3109arM b;
private Integer c;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.c(this.b, this.c, this.a, (InterfaceC9040dcH.Sts) obj);
}
{
this.b = c3109arM;
this.c = num;
this.a = intValue;
}
};
if (z2 && c3109arM.f != 0) {
ieS9.e(c3109arM.f);
}
ZI.IeS ieS10 = new ZI.IeS(c0463Hc2) { // from class: o.arZ
private C0463Hc c;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.a(this.c, (InterfaceC9040dcH.Sts) obj);
}
{
this.c = c0463Hc2;
}
};
if (c3109arM.f != 0) {
ieS10.e(c3109arM.f);
}
String format = c0463Hc2.e != null ? NumberFormat.getInstance(Locale.getDefault()).format(c0463Hc2.e) : "";
boolean z3 = !(format == null || gdZ.d((CharSequence) format));
ZI.IeS ieS11 = new ZI.IeS(c0463Hc2) { // from class: o.arR
private C0463Hc a;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.h(this.a, (InterfaceC9040dcH.Sts) obj);
}
{
this.a = c0463Hc2;
}
};
if (!z3 || c3109arM.f == 0) {
return;
}
ieS11.e(c3109arM.f);
}
@Override // androidx.fragment.app.Fragment
public final void onCreate(Bundle bundle) {
super.onCreate(bundle);
Bundle arguments = getArguments();
if (arguments != null) {
C0367Fb c0367Fb = (C0367Fb) arguments.getParcelable("EXTRA_CREDIT_CARD_DISPLAY_KEY");
if (c0367Fb != null) {
C14957gcv.c(c0367Fb, "");
this.d = c0367Fb;
}
C0367Fb c0367Fb2 = this.d;
C0463Hc c0463Hc = null;
if (c0367Fb2 == null) {
C14957gcv.a("");
c0367Fb2 = null;
}
String str = c0367Fb2.ab;
C14957gcv.c((Object) str, "");
this.g = str;
C0463Hc c0463Hc2 = (C0463Hc) arguments.getParcelable("EXTRA_PRODUCT_DISPLAY_MODEL_KEY");
if (c0463Hc2 != null) {
C14957gcv.c(c0463Hc2, "");
this.j = c0463Hc2;
}
C0463Hc c0463Hc3 = this.j;
if (c0463Hc3 == null) {
C14957gcv.a("");
} else {
c0463Hc = c0463Hc3;
}
c0463Hc.y = new C16316nR(getResources());
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroy() {
C3109arM c3109arM = this.presenter;
if (c3109arM == null) {
C14957gcv.a("");
c3109arM = null;
}
c3109arM.w_();
ImageView imageView = this.imageCover;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
imageView.setImageDrawable(null);
super.onDestroy();
}
@Override // o.InterfaceC9040dcH.Sts
public final void b() {
v("ecoupon_detail");
}
@Override // o.InterfaceC9040dcH.Sts
public final void a(String str) {
C14957gcv.e(str, "");
ImageView imageView = this.imageCover;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
C12891fKc.azD_(R.drawable.donations_place_holder, imageView, "https://fasteasy.scbeasy.com:8888/api/ccrewardredemption/".concat(String.valueOf(str)));
}
@Override // o.InterfaceC9040dcH.Sts
public final void c(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvAvailability;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str);
}
@Override // o.InterfaceC9040dcH.Sts
public final void d(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvName;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str);
}
@Override // o.InterfaceC9040dcH.Sts
public final void b(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvDescription;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str);
}
@Override // o.InterfaceC9040dcH.Sts
public final void g(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvValidityDate;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str);
}
@Override // o.InterfaceC9040dcH.Sts
public final void m(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvValidityDate;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(getString(R.string.e_coupon_detail_use_with_in_minutes, str));
}
@Override // o.InterfaceC9040dcH.Sts
public final void h(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvPoint;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str);
}
@Override // o.InterfaceC9040dcH.Sts
public final void e(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvCondition;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str);
}
@Override // o.InterfaceC9040dcH.Sts
public final void a() {
LinearLayout linearLayout = this.conditionLayout;
if (linearLayout == null) {
C14957gcv.a("");
linearLayout = null;
}
linearLayout.setVisibility(8);
}
@Override // o.InterfaceC9040dcH.Sts
public final void f(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvPointWarning;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setVisibility(0);
String string = getString(R.string.e_coupon_detail_point_warning_value, str);
C14957gcv.c((Object) string, "");
textView.setText(string);
}
@Override // o.InterfaceC9040dcH.Sts
public final void k(String str) {
C14957gcv.e(str, "");
TextView textView = this.txvWarningTime;
LinearLayout linearLayout = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setVisibility(0);
String string = getString(R.string.e_coupon_detail_time_warning, str);
C14957gcv.c((Object) string, "");
textView.setText(string);
LinearLayout linearLayout2 = this.warningTimeSection;
if (linearLayout2 != null) {
linearLayout = linearLayout2;
} else {
C14957gcv.a("");
}
linearLayout.setVisibility(0);
}
@Override // o.InterfaceC9040dcH.Sts
public final void d() {
Button button = this.btnNext;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(false);
}
@Override // o.InterfaceC9040dcH.Sts
public final void e() {
ImageView imageView = this.imageCover;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
imageView.setImageResource(R.drawable.donations_place_holder);
}
@Override // o.InterfaceC9040dcH.Sts
public final void b(C0489Ht c0489Ht, C0491Hv c0491Hv) {
C14957gcv.e(c0489Ht, "");
C14957gcv.e(c0491Hv, "");
Context context = getContext();
if (context != null) {
ECouponCommonActivity.IeS ieS = ECouponCommonActivity.b;
C0367Fb c0367Fb = this.d;
C0463Hc c0463Hc = null;
if (c0367Fb == null) {
C14957gcv.a("");
c0367Fb = null;
}
C0463Hc c0463Hc2 = this.j;
if (c0463Hc2 == null) {
C14957gcv.a("");
} else {
c0463Hc = c0463Hc2;
}
C14957gcv.e(context, "");
C14957gcv.e(c0367Fb, "");
C14957gcv.e(c0463Hc, "");
Intent intent = new Intent(context, (Class<?>) ECouponCommonActivity.class);
intent.putExtra("EXTRA_PAGE_TYPE_KEY", EnumC3162asM.E_COUPON_QUANTITY_PAGE);
intent.putExtra("EXTRA_CREDIT_CARD_DISPLAY_KEY", c0367Fb);
intent.putExtra("EXTRA_PRODUCT_DISPLAY_MODEL_KEY", c0463Hc);
intent.putExtra("EXTRA_E_COUPON_QUOTA_LIMIT_KEY", c0489Ht);
intent.putExtra("EXTRA_E_COUPON_QUANTITY_KEY", c0491Hv);
context.startActivity(intent);
}
}
@Override // o.InterfaceC9040dcH.Sts
public final void d(C0489Ht c0489Ht, C0491Hv c0491Hv) {
C14957gcv.e(c0489Ht, "");
C14957gcv.e(c0491Hv, "");
Context context = getContext();
if (context != null) {
ECouponCommonActivity.IeS ieS = ECouponCommonActivity.b;
C0367Fb c0367Fb = this.d;
C0463Hc c0463Hc = null;
if (c0367Fb == null) {
C14957gcv.a("");
c0367Fb = null;
}
C0463Hc c0463Hc2 = this.j;
if (c0463Hc2 == null) {
C14957gcv.a("");
} else {
c0463Hc = c0463Hc2;
}
context.startActivity(ECouponCommonActivity.IeS.ZJ_(context, c0367Fb, c0463Hc, c0489Ht, c0491Hv));
}
}
@OnClick
public final void onNextClick() {
final C3109arM c3109arM = this.presenter;
final C0463Hc c0463Hc = null;
if (c3109arM == null) {
C14957gcv.a("");
c3109arM = null;
}
C0367Fb c0367Fb = this.d;
if (c0367Fb == null) {
C14957gcv.a("");
c0367Fb = null;
}
final String str = c0367Fb.g;
C14957gcv.c((Object) str, "");
C0463Hc c0463Hc2 = this.j;
if (c0463Hc2 == null) {
C14957gcv.a("");
} else {
c0463Hc = c0463Hc2;
}
C14957gcv.e(str, "");
C14957gcv.e(c0463Hc, "");
ZI.IeS ieS = new ZI.IeS(str, c0463Hc, c3109arM) { // from class: o.arY
private C0463Hc b;
private String d;
private C3109arM e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3109arM.d(this.d, this.b, this.e, (InterfaceC9040dcH.Sts) obj);
}
{
this.d = str;
this.b = c0463Hc;
this.e = c3109arM;
}
};
if (c3109arM.f != 0) {
ieS.e(c3109arM.f);
}
}
@Override // o.InterfaceC9040dcH.Sts
public final void c() {
TextView textView = this.txvAvailability;
TextView textView2 = null;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
TextView textView3 = this.txvAvailability;
if (textView3 == null) {
C14957gcv.a("");
textView3 = null;
}
textView.setBackground(nMh.getDrawable(textView3.getContext(), R.drawable.trapezoid_red));
TextView textView4 = this.txvAvailability;
if (textView4 == null) {
C14957gcv.a("");
textView4 = null;
}
textView4.setGravity(17);
TextView textView5 = this.txvAvailability;
if (textView5 == null) {
C14957gcv.a("");
textView5 = null;
}
TextView textView6 = this.txvAvailability;
if (textView6 == null) {
C14957gcv.a("");
textView6 = null;
}
textView5.setTextColor(nMh.getColor(textView6.getContext(), R.color.f14042131100912));
TextView textView7 = this.txvAvailability;
if (textView7 == null) {
C14957gcv.a("");
textView7 = null;
}
textView7.setPaddingRelative((int) getResources().getDimension(R.dimen.f17292131165495), 0, (int) getResources().getDimension(R.dimen.f17522131165518), 0);
TextView textView8 = this.txvAvailability;
if (textView8 != null) {
textView2 = textView8;
} else {
C14957gcv.a("");
}
String string = getString(R.string.e_coupon_detail_sold_out);
C14957gcv.c((Object) string, "");
textView2.setText(string);
}
}