what-the-bank/sources/com/scb/phone/view/fragment/investment/onboarding/FundMaritalStatusFragment.java

405 lines
15 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.investment.onboarding;
import android.content.Context;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.adapter.investment.onboarding.SelectableChoiceAdapter;
import com.scb.phone.view.custom.common.CommonInputViewGroup;
import com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle;
import com.scb.phone.view.fragment.investment.onboarding.FundMaritalStatusFragment;
import java.util.Arrays;
import java.util.List;
import o.C0405Fw;
import o.C3697bDy;
import o.InterfaceC13391fZD;
import o.InterfaceC6669cZl;
import o.PQ;
import o.fIE;
/* loaded from: classes5.dex */
public class FundMaritalStatusFragment extends Hilt_FundMaritalStatusFragment implements InterfaceC6669cZl.jbe {
@BindView
Button buttonNext;
private List<ViewGroup> c;
private List<ViewGroup> d;
private String[] f;
@InterfaceC13391fZD
public C3697bDy fundMaritalPresenter;
private SelectableChoiceAdapter g;
private fIE i;
@BindView
CommonInputViewGroup inputFirstName;
@BindView
CommonInputViewGroup inputLastName;
@BindView
CommonInputViewGroup inputMiddleName;
@BindView
CommonInputViewGroup inputPassportId;
@BindView
CommonInputViewGroup inputSpouseId;
@BindView
LinearLayout layoutContainer;
@BindView
LinearLayout layoutDisclosed;
@BindView
LinearLayout layoutForeignerSpouse;
@BindView
LinearLayout layoutNotMarried;
@BindView
RadioButton radioDisclosed;
@BindView
RadioButton radioFore;
@BindView
RadioGroup radioGroupDisclosed;
@BindView
RadioGroup radioGroupSpouse;
@BindView
RadioButton radioTh;
@BindView
RadioButton radioUndisclosed;
@BindView
RecyclerView recyclerViewMaritalStatus;
@BindView
CustomSpinnerWithTitle spinnerCountry;
@BindView
CustomSpinnerWithTitle spinnerTitle;
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.investment.onboarding.Hilt_FundMaritalStatusFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof fIE) {
this.i = (fIE) context;
}
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559760, viewGroup, false);
ButterKnife.c(this, inflate);
this.fundMaritalPresenter.e((C3697bDy) this);
this.f = getResources().getStringArray(R.array.2130903061);
this.fundMaritalPresenter.a(C3697bDy.IeS.NONE);
this.buttonNext.setEnabled(false);
this.layoutNotMarried.setVisibility(8);
SelectableChoiceAdapter selectableChoiceAdapter = new SelectableChoiceAdapter(new SelectableChoiceAdapter.HBt(this) { // from class: o.fhB
private FundMaritalStatusFragment c;
@Override // com.scb.phone.view.adapter.investment.onboarding.SelectableChoiceAdapter.HBt
public final void e(String str, int i) {
FundMaritalStatusFragment.a(this.c, i);
}
{
this.c = this;
}
});
this.g = selectableChoiceAdapter;
List asList = Arrays.asList(this.f);
selectableChoiceAdapter.c.clear();
selectableChoiceAdapter.c.addAll(asList);
selectableChoiceAdapter.notifyDataSetChanged();
this.recyclerViewMaritalStatus.setAdapter(this.g);
this.spinnerTitle.setOnCustomSpinnerWithTitleCompletion(new CustomSpinnerWithTitle.LWm(this) { // from class: com.scb.phone.view.fragment.investment.onboarding.FundMaritalStatusFragment.1
private FundMaritalStatusFragment b;
{
this.b = this;
}
@Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm
public final void bn_() {
if (this.b.fundMaritalPresenter.a()) {
return;
}
C3697bDy c3697bDy = this.b.fundMaritalPresenter;
C3697bDy.e(new Object[]{c3697bDy, this.b.W()}, -1103146094, 1103146100, System.identityHashCode(c3697bDy));
}
@Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm
public final void bo_() {
C3697bDy c3697bDy = this.b.fundMaritalPresenter;
C3697bDy.e(new Object[]{c3697bDy}, -1693197173, 1693197177, System.identityHashCode(c3697bDy));
}
});
this.spinnerCountry.setOnCustomSpinnerWithTitleCompletion(new CustomSpinnerWithTitle.LWm(this) { // from class: com.scb.phone.view.fragment.investment.onboarding.FundMaritalStatusFragment.5
private FundMaritalStatusFragment e;
{
this.e = this;
}
@Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm
public final void bn_() {
this.e.fundMaritalPresenter.b();
}
@Override // com.scb.phone.view.custom.investment.onboarding.CustomSpinnerWithTitle.LWm
public final void bo_() {
this.e.fundMaritalPresenter.d();
}
});
if (this.c == null) {
this.c = Arrays.asList(this.spinnerTitle, this.inputFirstName, this.inputMiddleName, this.inputLastName, this.inputSpouseId);
for (int i = 0; i < this.c.size(); i++) {
ViewGroup viewGroup2 = this.c.get(i);
if (viewGroup2 instanceof CommonInputViewGroup) {
CommonInputViewGroup commonInputViewGroup = (CommonInputViewGroup) viewGroup2;
LWm lWm = new LWm(new LWm.HBt(this) { // from class: o.fhA
private FundMaritalStatusFragment a;
@Override // com.scb.phone.view.fragment.investment.onboarding.FundMaritalStatusFragment.LWm.HBt
public final void d(CharSequence charSequence, int i2) {
C3697bDy.e(new Object[]{this.a.fundMaritalPresenter, charSequence.toString(), Integer.valueOf(i2), true}, -1834630953, 1834630960, i2);
}
{
this.a = this;
}
}, i);
commonInputViewGroup.mEditText.addTextChangedListener(lWm);
commonInputViewGroup.d.add(lWm);
commonInputViewGroup.setOnFocusChangeListener(new Sts(this, i, true));
}
}
}
if (this.d == null) {
this.d = Arrays.asList(this.spinnerTitle, this.inputFirstName, this.inputMiddleName, this.inputLastName, this.spinnerCountry, this.inputPassportId);
for (int i2 = 0; i2 < this.d.size(); i2++) {
ViewGroup viewGroup3 = this.d.get(i2);
if (viewGroup3 instanceof CommonInputViewGroup) {
CommonInputViewGroup commonInputViewGroup2 = (CommonInputViewGroup) viewGroup3;
LWm lWm2 = new LWm(new LWm.HBt(this) { // from class: o.fhz
private FundMaritalStatusFragment c;
@Override // com.scb.phone.view.fragment.investment.onboarding.FundMaritalStatusFragment.LWm.HBt
public final void d(CharSequence charSequence, int i3) {
C3697bDy.e(new Object[]{this.c.fundMaritalPresenter, charSequence.toString(), Integer.valueOf(i3), false}, -1834630953, 1834630960, i3);
}
{
this.c = this;
}
}, i2);
commonInputViewGroup2.mEditText.addTextChangedListener(lWm2);
commonInputViewGroup2.d.add(lWm2);
commonInputViewGroup2.setOnFocusChangeListener(new Sts(this, i2, false));
}
}
}
v("mfonboard_maritalinfo");
return inflate;
}
@OnClick
public void onClickRadioButtonDisclosed() {
this.fundMaritalPresenter.a(C3697bDy.IeS.MARRIED_DISCLOSED_DESELECTED);
auT_(this.layoutContainer);
this.layoutDisclosed.setVisibility(0);
this.layoutForeignerSpouse.setVisibility(8);
this.inputSpouseId.setVisibility(8);
}
@OnClick
public void onClickRadioButtonUndisclosed() {
this.fundMaritalPresenter.a(C3697bDy.IeS.MARRIED_UNDISCLOSED);
auT_(this.layoutContainer);
this.layoutDisclosed.setVisibility(8);
}
@OnClick
public void onClickRadioButtonThaiSpouse() {
auT_(this.layoutContainer);
this.fundMaritalPresenter.a(C3697bDy.IeS.MARRIED_DISCLOSED_TH);
this.layoutForeignerSpouse.setVisibility(8);
this.inputSpouseId.setVisibility(0);
}
@OnClick
public void onClickRadioButtonForeignerSpouse() {
auT_(this.layoutContainer);
this.fundMaritalPresenter.a(C3697bDy.IeS.MARRIED_DISCLOSED_FOREIGNER);
this.layoutForeignerSpouse.setVisibility(0);
this.inputSpouseId.setVisibility(8);
}
@OnClick
public void onClickNext() {
this.fundMaritalPresenter.e(W(), this.g.e.getAdapterPosition(), this.radioGroupDisclosed.getCheckedRadioButtonId() != -1 ? Boolean.valueOf(this.radioDisclosed.isChecked()) : null, this.radioGroupSpouse.getCheckedRadioButtonId() != -1 ? this.radioTh.isChecked() : false, this.inputSpouseId.mEditText.getText().toString(), this.inputPassportId.mEditText.getText().toString(), this.spinnerCountry.d(), this.spinnerTitle.d(), this.inputFirstName.mEditText.getText().toString(), this.inputMiddleName.mEditText.getText().toString(), this.inputLastName.mEditText.getText().toString());
}
@Override // o.InterfaceC6669cZl.jbe
public final void e(boolean z) {
this.buttonNext.setEnabled(z);
}
@Override // o.InterfaceC6669cZl.jbe
public final void b() {
fIE fie = this.i;
if (fie != null) {
fie.s();
}
}
@Override // o.InterfaceC6669cZl.jbe
public final void e(int i) {
c(i).e();
}
private CommonInputViewGroup c(int i) {
if (this.radioGroupSpouse.getCheckedRadioButtonId() != -1 && this.radioFore.isChecked()) {
return (CommonInputViewGroup) this.d.get(i);
}
return (CommonInputViewGroup) this.c.get(i);
}
private void auT_(ViewGroup viewGroup) {
if (this.fundMaritalPresenter.c().step <= 1) {
this.radioGroupDisclosed.clearCheck();
}
if (this.fundMaritalPresenter.c().step <= 2) {
int childCount = viewGroup.getChildCount();
for (int i = 0; i < childCount; i++) {
View childAt = viewGroup.getChildAt(i);
if (childAt instanceof CustomSpinnerWithTitle) {
((CustomSpinnerWithTitle) childAt).b();
} else if (!(childAt instanceof CommonInputViewGroup)) {
if (childAt instanceof ViewGroup) {
auT_((ViewGroup) childAt);
}
} else {
((CommonInputViewGroup) childAt).mEditText.setText("");
}
}
this.radioGroupSpouse.clearCheck();
}
if (this.fundMaritalPresenter.c().step <= 3) {
this.inputPassportId.mEditText.setText("");
this.inputSpouseId.mEditText.setText("");
this.spinnerCountry.b();
}
}
/* loaded from: classes5.dex */
class Sts implements View.OnFocusChangeListener {
private FundMaritalStatusFragment a;
private boolean c;
private int e;
Sts(FundMaritalStatusFragment fundMaritalStatusFragment, int i, boolean z) {
this.a = fundMaritalStatusFragment;
this.e = i;
this.c = z;
}
@Override // android.view.View.OnFocusChangeListener
public final void onFocusChange(View view, boolean z) {
EditText editText = (EditText) view;
if (z) {
return;
}
C3697bDy c3697bDy = this.a.fundMaritalPresenter;
String obj = editText.getText().toString();
int i = this.e;
C3697bDy.e(new Object[]{c3697bDy, obj, Integer.valueOf(i), Boolean.valueOf(this.c)}, -1834630953, 1834630960, i);
}
}
/* loaded from: classes5.dex */
static class LWm implements TextWatcher {
private int b;
private HBt e;
/* loaded from: classes5.dex */
public interface HBt {
void d(CharSequence charSequence, int i);
}
@Override // android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
}
@Override // android.text.TextWatcher
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
LWm(HBt hBt, int i) {
this.e = hBt;
this.b = i;
}
@Override // android.text.TextWatcher
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
HBt hBt = this.e;
if (hBt != null) {
hBt.d(charSequence, this.b);
}
}
}
public static /* synthetic */ void a(FundMaritalStatusFragment fundMaritalStatusFragment, int i) {
if (i == 1) {
fundMaritalStatusFragment.fundMaritalPresenter.a(C3697bDy.IeS.MARRIED_DESELECTED);
fundMaritalStatusFragment.layoutNotMarried.setVisibility(0);
fundMaritalStatusFragment.layoutDisclosed.setVisibility(8);
} else {
fundMaritalStatusFragment.fundMaritalPresenter.a(C3697bDy.IeS.NON_MARRIED);
fundMaritalStatusFragment.layoutNotMarried.setVisibility(8);
}
fundMaritalStatusFragment.auT_(fundMaritalStatusFragment.layoutContainer);
}
@Override // o.InterfaceC6669cZl.jbe
public final void a(C0405Fw c0405Fw) {
this.spinnerCountry.setItemsWithPlaceholder(c0405Fw.c, true);
}
@Override // o.InterfaceC6669cZl.jbe
public final void c(PQ pq) {
if (pq != null) {
this.spinnerTitle.setItemsWithPlaceholder(pq.g, true);
}
}
@Override // o.InterfaceC6669cZl.jbe
public final void d(int i, int i2) {
CommonInputViewGroup c = c(i);
c.c();
c.setErrorText(getString(i2));
}
}