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

371 lines
12 KiB
Java

package com.scb.phone.view.fragment.ccrredemption.pointtopay;
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 androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.ccrredemption.pointtopay.PointToPayAdjustPointActivity;
import com.scb.phone.view.activity.ccrredemption.pointtopay.PointToPayReviewActivity;
import com.scb.phone.view.adapter.ccrredemption.pointtopay.PointToPaySelectPurchaseAdapter;
import com.scb.phone.view.fragment.BaseFragment;
import java.util.ArrayList;
import o.C0367Fb;
import o.C14957gcv;
import o.C3291auk;
import o.HB;
import o.HD;
import o.InterfaceC12078erS;
import o.InterfaceC13391fZD;
import o.InterfaceC9046dcN;
import o.ZI;
import o.pug;
/* loaded from: classes5.dex */
public final class PointToPaySelectPurchaseFragment extends Hilt_PointToPaySelectPurchaseFragment implements InterfaceC9046dcN.HBt, InterfaceC12078erS {
public static final IeS c = new IeS(0);
@BindView
public Button btNext;
private C0367Fb d;
private PointToPaySelectPurchaseAdapter f;
private ArrayList<C0367Fb> h;
private String i;
@BindView
public ImageView ivIconStatus;
private boolean j;
@BindView
public LinearLayout llBtNext;
@BindView
public LinearLayout llStatusLayout;
@InterfaceC13391fZD
public C3291auk presenter;
@BindView
public RecyclerView rvTransaction;
@BindView
public TextView tvSubTitleStatus;
@BindView
public TextView tvTitleStatus;
/* 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, "");
View inflate = layoutInflater.inflate(R.layout.2131559816, 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);
Bundle arguments = getArguments();
if (arguments != null) {
this.d = (C0367Fb) arguments.getParcelable("EXTRA_CREDIT_CARD_DISPLAY_KEY");
this.h = arguments.getParcelableArrayList("EXTRA_CREDIT_CARD_DISPLAY_LIST_KEY");
this.j = arguments.getBoolean("EXTRA_FROM_DEEP_LINK_KEY");
this.i = arguments.getString("EXTRA_DEEP_LINK_CHANNEL_KEY");
}
Button button = this.btNext;
final C3291auk c3291auk = null;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(false);
this.f = new PointToPaySelectPurchaseAdapter(this);
RecyclerView recyclerView = this.rvTransaction;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
recyclerView.getContext();
recyclerView.setLayoutManager(new LinearLayoutManager());
PointToPaySelectPurchaseAdapter pointToPaySelectPurchaseAdapter = this.f;
if (pointToPaySelectPurchaseAdapter == null) {
C14957gcv.a("");
pointToPaySelectPurchaseAdapter = null;
}
recyclerView.setAdapter(pointToPaySelectPurchaseAdapter);
C0367Fb c0367Fb = this.d;
if (c0367Fb != null) {
C3291auk c3291auk2 = this.presenter;
if (c3291auk2 == null) {
C14957gcv.a("");
c3291auk2 = null;
}
c3291auk2.e((C3291auk) this);
C3291auk c3291auk3 = this.presenter;
if (c3291auk3 == null) {
C14957gcv.a("");
c3291auk3 = null;
}
final boolean z = this.j;
final String str = this.i;
ZI.IeS ieS = new ZI.IeS(z, str) { // from class: o.auj
private boolean a;
private String e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3291auk.e(this.a, this.e, (InterfaceC9046dcN.HBt) obj);
}
{
this.a = z;
this.e = str;
}
};
if (c3291auk3.f != 0) {
ieS.e(c3291auk3.f);
}
C3291auk c3291auk4 = this.presenter;
if (c3291auk4 != null) {
c3291auk = c3291auk4;
} else {
C14957gcv.a("");
}
final String str2 = c0367Fb.g;
C14957gcv.c((Object) str2, "");
C14957gcv.e(str2, "");
ZI.IeS ieS2 = new ZI.IeS(c3291auk, str2) { // from class: o.auo
private String c;
private C3291auk e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3291auk.e(this.e, this.c, (InterfaceC9046dcN.HBt) obj);
}
{
this.e = c3291auk;
this.c = str2;
}
};
if (c3291auk.f != 0) {
ieS2.e(c3291auk.f);
}
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroyView() {
C3291auk c3291auk = this.presenter;
if (c3291auk == null) {
C14957gcv.a("");
c3291auk = null;
}
c3291auk.w_();
super.onDestroyView();
}
@Override // o.InterfaceC9046dcN.HBt
public final void d() {
v("point2pay_landing");
}
@Override // o.InterfaceC9046dcN.HBt
public final void a(ArrayList<HB> arrayList) {
C14957gcv.e(arrayList, "");
PointToPaySelectPurchaseAdapter pointToPaySelectPurchaseAdapter = this.f;
if (pointToPaySelectPurchaseAdapter == null) {
C14957gcv.a("");
pointToPaySelectPurchaseAdapter = null;
}
C14957gcv.e(arrayList, "");
pointToPaySelectPurchaseAdapter.e = arrayList;
pointToPaySelectPurchaseAdapter.notifyDataSetChanged();
}
@Override // o.InterfaceC9046dcN.HBt
public final void c() {
ImageView imageView = this.ivIconStatus;
TextView textView = null;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
imageView.setImageResource(R.drawable.ic_grey_warning);
TextView textView2 = this.tvTitleStatus;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setText(getString(R.string.auto_p2p_select_purchase_not_retrieve_title));
TextView textView3 = this.tvSubTitleStatus;
if (textView3 != null) {
textView = textView3;
} else {
C14957gcv.a("");
}
textView.setText(getString(R.string.auto_p2p_select_purchase_not_retrieve_description));
}
@Override // o.InterfaceC9046dcN.HBt
public final void a() {
ImageView imageView = this.ivIconStatus;
TextView textView = null;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
imageView.setImageResource(R.drawable.box_empty);
TextView textView2 = this.tvTitleStatus;
if (textView2 == null) {
C14957gcv.a("");
textView2 = null;
}
textView2.setText(getString(R.string.auto_p2p_select_purchase_no_eligible_title));
TextView textView3 = this.tvSubTitleStatus;
if (textView3 != null) {
textView = textView3;
} else {
C14957gcv.a("");
}
textView.setText(getString(R.string.auto_p2p_select_purchase_no_eligible_description));
}
@Override // o.InterfaceC12078erS
public final void a(HB hb) {
Button button = this.btNext;
C3291auk c3291auk = null;
if (button == null) {
C14957gcv.a("");
button = null;
}
button.setEnabled(true);
C3291auk c3291auk2 = this.presenter;
if (c3291auk2 != null) {
c3291auk = c3291auk2;
} else {
C14957gcv.a("");
}
c3291auk.e = hb;
}
@Override // o.InterfaceC9046dcN.HBt
public final void e(HD hd, String str) {
C14957gcv.e(hd, "");
C14957gcv.e(str, "");
Context context = getContext();
if (context != null) {
PointToPayAdjustPointActivity.HBt hBt = PointToPayAdjustPointActivity.k;
C0367Fb c0367Fb = this.d;
ArrayList<C0367Fb> arrayList = this.h;
String str2 = this.i;
C14957gcv.e(context, "");
Intent intent = new Intent(context, (Class<?>) PointToPayAdjustPointActivity.class);
intent.putExtra("EXTRA_CREDIT_CARD_DISPLAY_KEY", c0367Fb);
intent.putExtra("EXTRA_CREDIT_CARD_DISPLAY_LIST_KEY", arrayList);
intent.putExtra("EXTRA_TRANSACTION_DATA_DISPLAY_KEY", hd);
intent.putExtra("EXTRA_DEEP_LINK_CHANNEL_KEY", str2);
intent.putExtra("EXTRA_TERM_AND_CONDITION_URL", str);
context.startActivity(intent);
}
}
@Override // o.InterfaceC9046dcN.HBt
public final void a(HD hd, String str) {
C14957gcv.e(hd, "");
C14957gcv.e(str, "");
Context context = getContext();
if (context != null) {
PointToPayReviewActivity.IeS ieS = PointToPayReviewActivity.l;
context.startActivity(PointToPayReviewActivity.IeS.ZV_(context, this.d, this.h, hd, this.i, str));
}
}
@OnClick
public final void onNextClick() {
final HD hd;
final C3291auk c3291auk = this.presenter;
if (c3291auk == null) {
C14957gcv.a("");
c3291auk = null;
}
HB hb = c3291auk.e;
if (hb == null || (hd = hb.a) == null) {
return;
}
ZI.IeS ieS = new ZI.IeS(hd, c3291auk) { // from class: o.auh
private C3291auk b;
private HD e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3291auk.b(this.e, this.b, (InterfaceC9046dcN.HBt) obj);
}
{
this.e = hd;
this.b = c3291auk;
}
};
if (c3291auk.f != 0) {
ieS.e(c3291auk.f);
}
}
@Override // o.InterfaceC9046dcN.HBt
public final void e() {
c("push_noti", new pug("feature", "point2pay"));
}
@Override // o.InterfaceC9046dcN.HBt
public final void b() {
c("inbox_noti", new pug("feature", "point2pay"));
}
@Override // o.InterfaceC9046dcN.HBt
public final void g() {
RecyclerView recyclerView = this.rvTransaction;
LinearLayout linearLayout = null;
if (recyclerView == null) {
C14957gcv.a("");
recyclerView = null;
}
recyclerView.setVisibility(4);
LinearLayout linearLayout2 = this.llBtNext;
if (linearLayout2 == null) {
C14957gcv.a("");
linearLayout2 = null;
}
linearLayout2.setVisibility(4);
LinearLayout linearLayout3 = this.llStatusLayout;
if (linearLayout3 != null) {
linearLayout = linearLayout3;
} else {
C14957gcv.a("");
}
linearLayout.setVisibility(0);
}
}