what-the-bank/sources/com/scb/phone/view/fragment/creditcard/PointTabFragment.java

399 lines
12 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.creditcard;
import android.content.ActivityNotFoundException;
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.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
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.ccrredemption.categories.RewardsHomeActivity;
import com.scb.phone.view.activity.ccrredemption.ecoupon.MyECouponActivity;
import com.scb.phone.view.activity.ccrredemption.pointtopay.PointToPayIntroductionActivity;
import com.scb.phone.view.fragment.BaseFragment;
import java.util.ArrayList;
import java.util.List;
import o.C0367Fb;
import o.C10456eEq;
import o.C1331aAx;
import o.C1333aAz;
import o.InterfaceC13391fZD;
import o.InterfaceC6618cYI;
import o.PNS;
import o.TDT;
import o.ZI;
import o.aAK;
import o.aAO;
import o.guQ;
/* loaded from: classes5.dex */
public class PointTabFragment extends Hilt_PointTabFragment implements InterfaceC6618cYI.RVV {
C0367Fb c;
Sts d;
@BindView
TextView errorMessage;
@BindView
FrameLayout flPointXInfoTile;
Button h;
@BindView
ImageView ivErrorIcon;
@BindView
ImageView ivPointXInfoTile;
private ArrayList<C0367Fb> j;
@BindView
View lineAboveGroupMenu;
@BindView
LinearLayout llContentViewLayout;
@BindView
LinearLayout llErrorLayout;
@BindView
ConstraintLayout myECouponLayout;
@BindView
ConstraintLayout payPointToPay;
@InterfaceC13391fZD
public C1333aAz pointTabPresenter;
@BindView
ConstraintLayout redeemPointLayout;
@BindView
LinearLayout remarksLayout;
@BindView
ViewGroup rootView;
@InterfaceC13391fZD
public TDT toggleCache;
@BindView
TextView tvCreditCardDetailPoints;
@BindView
TextView tvErrorDesc;
@BindView
TextView tvErrorTitle;
@BindView
TextView tvExpireRemarks;
@BindView
TextView tvMCardRemarks;
@BindView
TextView tvPointUnit;
@BindView
LinearLayout viewHavePoints;
@BindView
LinearLayout viewUnablePoints;
/* loaded from: classes5.dex */
public interface Sts {
Button art_();
void c(C0367Fb c0367Fb);
}
public static PointTabFragment a(C0367Fb c0367Fb, List<C0367Fb> list) {
Bundle bundle = new Bundle();
bundle.putParcelable("EXTRA_CREDIT_CARD_DISPLAY_KEY", c0367Fb);
bundle.putParcelableArrayList("EXTRA_CREDIT_CARD_DISPLAY_LIST_KEY", new ArrayList<>(list));
PointTabFragment pointTabFragment = new PointTabFragment();
pointTabFragment.setArguments(bundle);
return pointTabFragment;
}
@Override // androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (getArguments() != null) {
this.c = (C0367Fb) getArguments().getParcelable("EXTRA_CREDIT_CARD_DISPLAY_KEY");
this.j = getArguments().getParcelableArrayList("EXTRA_CREDIT_CARD_DISPLAY_LIST_KEY");
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559523, viewGroup, false);
((BaseFragment) this).a = ButterKnife.c(this, inflate);
this.pointTabPresenter.e((C1333aAz) this);
C1333aAz c1333aAz = this.pointTabPresenter;
ZI.IeS ieS = new ZI.IeS() { // from class: o.aAC
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6618cYI.RVV) obj).a();
}
};
if (c1333aAz.f != 0) {
ieS.e(c1333aAz.f);
}
C1333aAz c1333aAz2 = this.pointTabPresenter;
C1331aAx c1331aAx = new C1331aAx(c1333aAz2, this.c);
if (c1333aAz2.f != 0) {
c1331aAx.e(c1333aAz2.f);
}
return inflate;
}
@Override // o.InterfaceC6618cYI.RVV
public final void a() {
n();
Button button = this.h;
if (button != null) {
button.setEnabled(false);
}
}
@Override // o.InterfaceC6618cYI.RVV
public final void h() {
boolean z = false;
if (isAdded()) {
v();
this.viewUnablePoints.setVisibility(8);
this.viewHavePoints.setVisibility(8);
C1333aAz c1333aAz = this.pointTabPresenter;
aAK aak = new aAK(z);
if (c1333aAz.f != 0) {
aak.e(c1333aAz.f);
}
}
this.lineAboveGroupMenu.setVisibility(0);
}
@Override // o.InterfaceC6618cYI.RVV
public final void a(String str) {
if (isAdded()) {
aq_();
this.viewHavePoints.setVisibility(8);
this.viewUnablePoints.setVisibility(0);
this.errorMessage.setText(str);
C1333aAz c1333aAz = this.pointTabPresenter;
aAK aak = new aAK(false);
if (c1333aAz.f != 0) {
aak.e(c1333aAz.f);
}
}
this.lineAboveGroupMenu.setVisibility(8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void j() {
if (isAdded()) {
aq_();
this.viewHavePoints.setVisibility(8);
this.viewUnablePoints.setVisibility(0);
this.errorMessage.setText(R.string.credit_card_unable_points);
C1333aAz c1333aAz = this.pointTabPresenter;
aAK aak = new aAK(false);
if (c1333aAz.f != 0) {
aak.e(c1333aAz.f);
}
}
this.lineAboveGroupMenu.setVisibility(8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void g() {
this.myECouponLayout.setVisibility(0);
}
@Override // o.InterfaceC6618cYI.RVV
public final void d(boolean z) {
this.redeemPointLayout.setVisibility(z ? 0 : 8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void a(boolean z) {
this.payPointToPay.setVisibility(z ? 0 : 8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void a(C0367Fb c0367Fb) {
this.remarksLayout.setVisibility(0);
this.tvExpireRemarks.setText(String.format(getString(R.string.credit_card_message_m_card), c0367Fb.f, c0367Fb.P, c0367Fb.i));
this.lineAboveGroupMenu.setVisibility(8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void b() {
this.remarksLayout.setVisibility(8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void c(boolean z) {
Button button = this.h;
if (button != null) {
button.setEnabled(z);
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
this.pointTabPresenter.w_();
super.onDestroyView();
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onActivityResult(int i, int i2, Intent intent) {
Sts sts;
super.onActivityResult(i, i2, intent);
if (i != 7200 || (sts = this.d) == null) {
return;
}
sts.c(this.c);
}
@Override // androidx.fragment.app.Fragment
public void onDetach() {
super.onDetach();
this.d = null;
this.h = null;
}
@Override // o.InterfaceC6618cYI.RVV
public final void e() {
this.ivErrorIcon.setImageResource(R.drawable.box_empty);
this.tvErrorTitle.setText(R.string.auto_cc_detail_no_result_title);
this.tvErrorDesc.setText(R.string.auto_cc_detail_no_result_desc);
this.llErrorLayout.setVisibility(0);
this.llContentViewLayout.setVisibility(8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void d() {
this.llErrorLayout.setVisibility(8);
this.llContentViewLayout.setVisibility(0);
}
@Override // o.InterfaceC6618cYI.RVV
public final void i() {
this.llContentViewLayout.setVisibility(0);
this.flPointXInfoTile.setVisibility(0);
}
@Override // o.InterfaceC6618cYI.RVV
public final void f() {
this.llContentViewLayout.setVisibility(0);
this.flPointXInfoTile.setVisibility(8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void c() {
this.llContentViewLayout.setVisibility(8);
this.llErrorLayout.setVisibility(0);
}
@Override // o.InterfaceC6618cYI.RVV
public final void b(String str) {
C10456eEq.aqe_(this.ivPointXInfoTile, str, new PNS().c(R.color.f3412131099849).a(R.color.f3412131099849));
}
public static /* synthetic */ void e(PointTabFragment pointTabFragment) {
pointTabFragment.v("reward_entry_pointbutton");
pointTabFragment.v("reward_entry_redeemmenu");
pointTabFragment.startActivityForResult(RewardsHomeActivity.ZH_(pointTabFragment.getActivity(), pointTabFragment.c), 7200);
}
@OnClick
public void onClickMyECoupon() {
startActivity(MyECouponActivity.ZM_(requireContext(), this.c.g));
}
@OnClick
public void onClickPointToPay() {
v("reward_entry_point2pay");
startActivityForResult(PointToPayIntroductionActivity.ZT_(requireContext(), this.c, this.j), 7200);
}
@OnClick
public void onClickPointXInfoTile() {
try {
startActivity(new Intent(CommonConstant.ACTION.HWID_SCHEME_URL, Uri.parse("scbeasy://pointxlanding")));
} catch (ActivityNotFoundException e) {
guQ.e(e);
}
}
@OnClick
public void onClickRedeemPoint() {
v("reward_entry_pointbutton");
v("reward_entry_redeemmenu");
startActivityForResult(RewardsHomeActivity.ZH_(getActivity(), this.c), 7200);
}
@Override // o.InterfaceC6618cYI.RVV
public final void e(C0367Fb c0367Fb) {
if (c0367Fb.ab != null) {
aq_();
this.viewUnablePoints.setVisibility(8);
this.viewHavePoints.setVisibility(0);
this.tvCreditCardDetailPoints.setText(c0367Fb.ab);
TextView textView = this.tvPointUnit;
StringBuilder sb = new StringBuilder(" ");
sb.append(c0367Fb.P);
textView.setText(sb.toString());
}
this.lineAboveGroupMenu.setVisibility(8);
}
@Override // o.InterfaceC6618cYI.RVV
public final void b(C0367Fb c0367Fb) {
boolean z = false;
if (c0367Fb.ab != null && isAdded()) {
aq_();
this.viewUnablePoints.setVisibility(8);
this.viewHavePoints.setVisibility(0);
this.tvCreditCardDetailPoints.setText(c0367Fb.ab);
TextView textView = this.tvPointUnit;
StringBuilder sb = new StringBuilder(" ");
sb.append(c0367Fb.P);
textView.setText(sb.toString());
C1333aAz c1333aAz = this.pointTabPresenter;
aAK aak = new aAK(true);
if (c1333aAz.f != 0) {
aak.e(c1333aAz.f);
}
} else {
C1333aAz c1333aAz2 = this.pointTabPresenter;
aAK aak2 = new aAK(z);
if (c1333aAz2.f != 0) {
aak2.e(c1333aAz2.f);
}
}
this.lineAboveGroupMenu.setVisibility(8);
}
public final void n() {
C1333aAz c1333aAz = this.pointTabPresenter;
aAO aao = new aAO(false);
if (c1333aAz.f != 0) {
aao.e(c1333aAz.f);
}
this.pointTabPresenter.e(this.c, this.toggleCache.m);
this.pointTabPresenter.b(this.c);
}
}