what-the-bank/sources/com/scb/phone/view/fragment/hml/HmlAddressFragment.java

156 lines
6.3 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.hml;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.fragment.ntb.address.BaseAddressFragment;
import o.C6583cXR;
import o.C6921ceY;
import o.GJE;
import o.SP;
/* loaded from: classes5.dex */
public class HmlAddressFragment extends Hilt_HmlAddressFragment {
private boolean c = false;
private RVV d;
/* loaded from: classes5.dex */
public interface RVV {
void d(String str);
}
public static HmlAddressFragment c(SP sp, GJE.Sts sts) {
HmlAddressFragment hmlAddressFragment = new HmlAddressFragment();
Bundle bundle = new Bundle();
bundle.putParcelable("com.scb.phone.view.fragment.easycash.financial_information.ADDRESS_DISPLAY", sp);
bundle.putSerializable("com.scb.phone.EXTRA_ADDRESS_TYPE", sts);
hmlAddressFragment.setArguments(bundle);
return hmlAddressFragment;
}
@Override // androidx.fragment.app.Fragment
public void onStart() {
SP sp;
super.onStart();
Bundle arguments = getArguments();
if (this.c || arguments == null || !arguments.containsKey("com.scb.phone.view.fragment.easycash.financial_information.ADDRESS_DISPLAY") || (sp = (SP) arguments.getParcelable("com.scb.phone.view.fragment.easycash.financial_information.ADDRESS_DISPLAY")) == null) {
return;
}
((BaseAddressFragment) this).f = sp;
c(sp, true);
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment
@OnClick
public void onSelectProvinceClick() {
this.c = true;
super.onSelectProvinceClick();
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.scb.phone.view.fragment.hml.Hilt_HmlAddressFragment, com.scb.phone.view.fragment.ntb.address.BaseAddressFragment, com.scb.phone.view.fragment.ntb.address.Hilt_BaseAddressFragment, com.scb.phone.view.fragment.Hilt_BaseFragment, androidx.fragment.app.Fragment
public void onAttach(Context context) {
super.onAttach(context);
if (getParentFragment() instanceof RVV) {
this.d = (RVV) getParentFragment();
} else {
if (context instanceof RVV) {
this.d = (RVV) context;
return;
}
StringBuilder sb = new StringBuilder();
sb.append(context.toString());
sb.append(" must implement HmlAddressListener");
throw new ClassCastException(sb.toString());
}
}
@Override // androidx.fragment.app.Fragment
public void onDetach() {
this.d = null;
super.onDetach();
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment, androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
if (bundle != null) {
bundle.putInt("BUNDLE_ADDRESS_TYPE", 0);
}
View onCreateView = super.onCreateView(layoutInflater, viewGroup, bundle);
this.presenter.a(true);
((BaseAddressFragment) this).j = "TH";
this.layoutCustomSpinner.setVisibility(8);
if (getArguments() != null && getArguments().containsKey("com.scb.phone.EXTRA_ADDRESS_TYPE")) {
try {
int i = AnonymousClass3.a[((GJE.Sts) getArguments().getSerializable("com.scb.phone.EXTRA_ADDRESS_TYPE")).ordinal()];
if (i == 1) {
this.g = getString(R.string.hml_personal_info_home_address);
} else if (i == 2) {
this.g = getString(R.string.hml_personal_info_mailing_address);
} else if (i == 3) {
this.g = getString(R.string.hml_occupation_work_address);
} else if (i == 4) {
this.g = getString(R.string.hml_business_info_address_title);
}
} catch (ClassCastException unused) {
}
}
return onCreateView;
}
/* renamed from: com.scb.phone.view.fragment.hml.HmlAddressFragment$3, reason: invalid class name */
/* loaded from: classes5.dex */
static /* synthetic */ class AnonymousClass3 {
static final int[] a;
static {
int[] iArr = new int[GJE.Sts.values().length];
a = iArr;
try {
iArr[GJE.Sts.HOME.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[GJE.Sts.MAILING.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[GJE.Sts.WORK.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[GJE.Sts.BUSINESS.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
}
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment
public void onNextButtonClick() {
GJE.Sts sts;
C6921ceY c6921ceY = this.presenter;
if (getArguments() != null) {
sts = (GJE.Sts) getArguments().getSerializable("com.scb.phone.EXTRA_ADDRESS_TYPE");
} else {
sts = GJE.Sts.MAILING;
}
c6921ceY.d(sts, W(), this.unit.inputTextField.getText().toString().trim(), this.floor.inputTextField.getText().toString().trim(), this.houseNo.inputTextField.getText().toString().trim(), this.village.inputTextField.getText().toString().trim(), this.moo.inputTextField.getText().toString().trim(), this.alley.inputTextField.getText().toString().trim(), this.roadTH.inputTextField.getText().toString().trim(), C6583cXR.x(this.subDistrictLabel.getText().toString()), C6583cXR.x(this.districtLabel.getText().toString()), C6583cXR.x(this.provinceLabel.getText().toString()), C6583cXR.x(this.postalCodeLabel.getText().toString()));
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment, o.InterfaceC8954dab.LWm
public final void d(String str) {
super.d(str);
this.d.d(str);
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroyView() {
this.presenter.w_();
super.onDestroyView();
}
}