what-the-bank/sources/com/scb/phone/view/fragment/remittance/RemittanceSenderAddressFrag...

222 lines
8.3 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.remittance;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.FragmentActivity;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.remittance.RemittanceAddressSearchActivity;
import o.AbstractC13163fSk;
import o.C0406Fx;
import o.C10241dz;
import o.C14866gag;
import o.C14957gcv;
import o.C5946cDz;
import o.C8060dA;
import o.EhV;
import o.InterfaceC13391fZD;
import o.InterfaceC9566dmE;
import o.LFv;
import o.QKH;
import o.SP;
import o.UO;
import o.fSQ;
/* loaded from: classes5.dex */
public final class RemittanceSenderAddressFragment extends Hilt_RemittanceSenderAddressFragment implements InterfaceC9566dmE {
public static final RVV c = new RVV(0);
@InterfaceC13391fZD
public C5946cDz senderAddressPresenter;
/* loaded from: classes5.dex */
public static final class RVV {
private RVV() {
}
public /* synthetic */ RVV(byte b) {
this();
}
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment, androidx.fragment.app.Fragment
public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
this.g = getString(R.string.remittance_sender_address_section_header);
C5946cDz c5946cDz = this.senderAddressPresenter;
if (c5946cDz == null) {
C14957gcv.a("");
c5946cDz = null;
}
c5946cDz.e((C5946cDz) this);
return super.onCreateView(layoutInflater, viewGroup, bundle);
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment, androidx.fragment.app.Fragment
public final void onViewCreated(View view, Bundle bundle) {
Parcelable parcelable;
C14957gcv.e(view, "");
super.onViewCreated(view, bundle);
this.houseNo.d();
this.moo.d();
this.roadTH.d();
this.floor.d();
this.unit.d();
this.village.d();
this.alley.d();
this.presenter.a(true);
Bundle arguments = getArguments();
if (arguments != null) {
if (Build.VERSION.SDK_INT >= 33) {
parcelable = (Parcelable) arguments.getParcelable("KEY_ADDRESS_DISPLAY", UO.class);
} else {
Parcelable parcelable2 = arguments.getParcelable("KEY_ADDRESS_DISPLAY");
if (!(parcelable2 instanceof UO)) {
parcelable2 = null;
}
parcelable = (UO) parcelable2;
}
UO uo = (UO) parcelable;
if (uo != null) {
SP sp = new SP();
sp.h = uo.e.i;
sp.t = uo.e.l;
sp.p = uo.e.g;
sp.m = uo.e.k;
sp.i = uo.e.j;
sp.k = uo.e.m;
sp.f = uo.e.b;
sp.n = uo.e.f8387o;
sp.c = uo.e.c;
sp.a = uo.e.n;
sp.g = uo.e.f;
sp.d = uo.e.a;
sp.l = uo.e.h;
sp.j = uo.e.e;
C14957gcv.c(sp, "");
c(sp, true);
}
}
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment
@OnClick
public final void onSelectProvinceClick() {
String str;
QKH qkh = this.i;
if (getActivity() != null) {
qkh.c(((BaseActivity) getActivity()).scbAnalytics, "ekyc_subdistrict");
}
RemittanceAddressSearchActivity.Sts sts = RemittanceAddressSearchActivity.b;
Context context = getContext();
if (getActivity() instanceof BaseActivity) {
str = (String) BaseActivity.a(new Object[]{(BaseActivity) getActivity()}, 1198611792, -1198611784, ((Context) Class.forName("android.app.ActivityThread").getMethod("currentApplication", new Class[0]).invoke(null, null)).getApplicationContext().getResources().getString(R.string.debit_card_banking_action).substring(18, 19).codePointAt(0) + 597686520);
} else {
str = "";
}
C14957gcv.c((Object) str, "");
C14957gcv.e(str, "");
Intent putExtra = new Intent(context, (Class<?>) RemittanceAddressSearchActivity.class).putExtra("com.scb.phone.view.activity.easycash.EXTRA_SEARCH_TITLE", str);
C14957gcv.c(putExtra, "");
startActivityForResult(putExtra, 10002);
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment
@OnClick
public final void onNextButtonClick() {
C10241dz c10241dz = new C10241dz(new C8060dA(this.houseNo.inputTextField.getText().toString().trim(), this.unit.inputTextField.getText().toString().trim(), this.floor.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(), this.districtLabel.getText().toString(), this.subDistrictLabel.getText().toString(), this.provinceLabel.getText().toString(), this.postalCodeLabel.getText().toString(), null, 10272));
final C5946cDz c5946cDz = this.senderAddressPresenter;
if (c5946cDz == null) {
C14957gcv.a("");
c5946cDz = null;
}
C14957gcv.e(c10241dz, "");
EhV ehV = c5946cDz.e;
C14957gcv.e(c10241dz, "");
AbstractC13163fSk<LFv> e = ehV.c.e(c10241dz);
C14957gcv.c(e, "");
ehV.d(e, new fSQ(c5946cDz) { // from class: o.cDB
private C5946cDz a;
@Override // o.fSQ
public final void c(Object obj) {
C5946cDz.d(this.a, (LFv) obj);
}
{
this.a = c5946cDz;
}
}, new fSQ(c5946cDz) { // from class: o.cDx
private C5946cDz b;
@Override // o.fSQ
public final void c(Object obj) {
C5946cDz.c(this.b, (Throwable) obj);
}
{
this.b = c5946cDz;
}
});
}
@Override // o.InterfaceC9566dmE
public final void b(UO uo) {
C14957gcv.e(uo, "");
FragmentActivity activity = getActivity();
if (activity != null) {
Intent intent = new Intent();
intent.putExtra("USER_ADDRESS_DISPLAY", uo);
C14866gag c14866gag = C14866gag.c;
activity.setResult(-1, intent);
}
FragmentActivity activity2 = getActivity();
if (activity2 != null) {
activity2.finish();
}
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onDestroyView() {
C5946cDz c5946cDz = this.senderAddressPresenter;
if (c5946cDz == null) {
C14957gcv.a("");
c5946cDz = null;
}
c5946cDz.w_();
super.onDestroyView();
}
@Override // com.scb.phone.view.fragment.ntb.address.BaseAddressFragment, com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public final void onActivityResult(int i, int i2, Intent intent) {
if (i == 10002 && i2 == -1 && intent != null) {
if (Build.VERSION.SDK_INT >= 33) {
Bundle extras = intent.getExtras();
if (extras != null) {
r1 = (Parcelable) extras.getParcelable("SUB_DISTRICT_DISPLAY", C0406Fx.class);
}
} else {
Bundle extras2 = intent.getExtras();
Parcelable parcelable = extras2 != null ? extras2.getParcelable("SUB_DISTRICT_DISPLAY") : null;
r1 = (C0406Fx) (parcelable instanceof C0406Fx ? parcelable : null);
}
C0406Fx c0406Fx = (C0406Fx) r1;
if (c0406Fx != null) {
this.subDistrictLabel.setText(c0406Fx.g);
this.districtLabel.setText(c0406Fx.a);
this.provinceLabel.setText(c0406Fx.j);
this.postalCodeLabel.setText(c0406Fx.c);
f();
d(true);
}
}
}
}