what-the-bank/sources/com/scb/phone/view/fragment/investment/scbs/AddAccountInfoFragment.java

274 lines
9.1 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.investment.scbs;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.text.Layout;
import android.text.SpannableString;
import android.text.style.AlignmentSpan;
import android.text.style.BulletSpan;
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 butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.investment.scbs.AddAccountConsentActivity;
import com.scb.phone.view.activity.investment.scbs.open.ScbsOnboardingConsentActivity;
import com.scb.phone.view.activity.singleform.SingleFormLandingActivity;
import o.C13396fZU;
import o.C15716hvG;
import o.C3804bHa;
import o.C3812bHi;
import o.EnumC1274Zk;
import o.InterfaceC13391fZD;
import o.InterfaceC9352diC;
import o.ZI;
import o.nMh;
/* loaded from: classes5.dex */
public class AddAccountInfoFragment extends Hilt_AddAccountInfoFragment implements InterfaceC9352diC {
@BindView
protected Button btAddAccount;
@BindView
protected Button btOpenAccount;
private int c = 0;
@BindView
protected ImageView ivAddIcon;
@BindView
protected ImageView ivEmptyIcon;
@InterfaceC13391fZD
public C3804bHa presenter;
@BindView
protected TextView tvTextBody;
@BindView
protected TextView tvTextRemark;
public static AddAccountInfoFragment a(int i) {
Bundle bundle = new Bundle();
bundle.putInt("EXTRA_FLOW_TYPE", i);
AddAccountInfoFragment addAccountInfoFragment = new AddAccountInfoFragment();
addAccountInfoFragment.setArguments(bundle);
return addAccountInfoFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559446, viewGroup, false);
ButterKnife.c(this, inflate);
if (getArguments() != null) {
this.c = getArguments().getInt("EXTRA_FLOW_TYPE", 0);
}
this.presenter.e((C3804bHa) this);
C3804bHa c3804bHa = this.presenter;
int i = this.c;
EnumC1274Zk.LWm lWm = EnumC1274Zk.Companion;
c3804bHa.c = EnumC1274Zk.LWm.a(c3804bHa.b.d.e.c());
if (i == 1) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.bHd
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9352diC) obj).f();
}
};
if (c3804bHa.f != 0) {
ieS.e(c3804bHa.f);
}
} else if (i == 2) {
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.bHe
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9352diC) obj).a();
}
};
if (c3804bHa.f != 0) {
ieS2.e(c3804bHa.f);
}
} else if (i == 3) {
ZI.IeS ieS3 = new ZI.IeS() { // from class: o.bHg
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9352diC) obj).c();
}
};
if (c3804bHa.f != 0) {
ieS3.e(c3804bHa.f);
}
} else {
ZI.IeS ieS4 = new ZI.IeS() { // from class: o.bHc
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9352diC) obj).h();
}
};
if (c3804bHa.f != 0) {
ieS4.e(c3804bHa.f);
}
}
if (c3804bHa.e.c.d()) {
C3812bHi c3812bHi = new C3812bHi(c3804bHa);
if (c3804bHa.f != 0) {
c3812bHi.e(c3804bHa.f);
}
}
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
this.presenter.w_();
super.onDestroy();
}
@Override // o.InterfaceC9352diC
public final void b() {
AddAccountConsentActivity.a(getContext());
}
@Override // o.InterfaceC9352diC
public final void d() {
ScbsOnboardingConsentActivity.d(getContext());
}
@Override // o.InterfaceC9352diC
public final void e() {
if (getContext() != null) {
SingleFormLandingActivity.e(getContext(), false, false);
}
}
@Override // o.InterfaceC9352diC
public final void h() {
i();
this.btOpenAccount.setVisibility(0);
this.btAddAccount.setVisibility(0);
this.ivAddIcon.setVisibility(0);
}
@Override // o.InterfaceC9352diC
public final void f() {
i();
this.btOpenAccount.setVisibility(0);
this.btAddAccount.setVisibility(8);
this.ivAddIcon.setVisibility(8);
}
private void i() {
this.tvTextBody.setText(R.string.auto_open_scbs_account_description);
this.tvTextBody.setTextAlignment(4);
this.tvTextRemark.setText(R.string.auto_open_scbs_account_remark);
this.tvTextRemark.setTextAlignment(4);
this.tvTextRemark.setVisibility(0);
}
@Override // o.InterfaceC9352diC
public final void a() {
g();
String string = getString(R.string.auto_robo_advisor_open_scbs_account_topic);
String string2 = getString(R.string.auto_robo_advisor_open_scbs_account_stop_1);
String string3 = getString(R.string.auto_robo_advisor_open_scbs_account_stop_2);
String string4 = getString(R.string.robo_body_text_format_open, string, string2, string3, getString(R.string.auto_robo_advisor_open_scbs_account_stop_3));
int indexOf = string4.indexOf(string2);
int length = string2.length();
int indexOf2 = string4.indexOf(string3);
int length2 = string3.length();
SpannableString spannableString = new SpannableString(string4);
spannableString.setSpan(new AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER), 0, string.length(), 33);
getResources();
spannableString.setSpan(new BulletSpan(30), indexOf, length + indexOf, 18);
spannableString.setSpan(new BulletSpan(30), indexOf2, length2 + indexOf2, 18);
this.tvTextBody.setText(spannableString);
this.tvTextRemark.setVisibility(8);
this.btOpenAccount.setText(getString(R.string.auto_robo_advisor_open_scbs_button_open));
this.btAddAccount.setText(getString(R.string.auto_robo_advisor_open_scbs_button_add));
this.ivAddIcon.setImageResource(R.drawable.ic_add_button);
}
@Override // o.InterfaceC9352diC
public final void c() {
g();
this.tvTextBody.setText(getString(R.string.robo_body_text_format_add, getString(R.string.auto_robo_advisor_add_scbs_account_stop_1), getString(R.string.auto_robo_advisor_add_scbs_account_stop_2), getString(R.string.auto_robo_advisor_add_scbs_account_stop_3)));
this.tvTextBody.setTextAlignment(4);
this.tvTextRemark.setVisibility(8);
this.btOpenAccount.setText(getString(R.string.auto_robo_advisor_open_scbs_button_open));
this.btAddAccount.setVisibility(8);
this.ivAddIcon.setVisibility(8);
}
private void g() {
this.ivEmptyIcon.setImageResource(R.drawable.empty_state_icon);
if (getContext() != null) {
this.ivEmptyIcon.setColorFilter(nMh.getColor(getContext(), R.color.f13682131100876), PorterDuff.Mode.SRC_IN);
}
}
@Override // o.InterfaceC9352diC
public final void a(String str) {
v(str);
}
@Override // o.InterfaceC9352diC
public final void c(C13396fZU<String, C15716hvG> c13396fZU) {
g(c13396fZU);
}
@OnClick
public void onAddButtonClicked() {
C3804bHa c3804bHa = this.presenter;
int i = this.c;
if (i == 2 || i == 3) {
ZI.IeS ieS = new ZI.IeS() { // from class: o.bHh
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9352diC) obj).a("roboadvisor_open_add_acc");
}
};
if (c3804bHa.f != 0) {
ieS.e(c3804bHa.f);
}
}
ZI.IeS ieS2 = new ZI.IeS() { // from class: o.bHj
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC9352diC) obj).b();
}
};
if (c3804bHa.f != 0) {
ieS2.e(c3804bHa.f);
}
}
@OnClick
public void onOpenButtonClicked() {
final C3804bHa c3804bHa = this.presenter;
final int i = this.c;
ZI.IeS ieS = new ZI.IeS(i, c3804bHa) { // from class: o.bHf
private int b;
private C3804bHa d;
@Override // o.ZI.IeS
public final void e(Object obj) {
C3804bHa.a(this.b, this.d, (InterfaceC9352diC) obj);
}
{
this.b = i;
this.d = c3804bHa;
}
};
if (c3804bHa.f != 0) {
ieS.e(c3804bHa.f);
}
}
}