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

194 lines
6.1 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.hml;
import android.os.Bundle;
import android.text.Editable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import com.scb.phone.view.custom.common.CommonInputViewGroup;
import com.scb.phone.view.fragment.BaseFragment;
import com.squareup.picasso.Picasso;
import java.util.List;
import o.AbstractC5073bmE;
import o.C13020fOa;
import o.C14957gcv;
import o.C5045bld;
import o.InterfaceC9336dhn;
import o.ZI;
import o.fHS;
import o.fJJ;
/* loaded from: classes5.dex */
public abstract class HmlBaseOperatingAccountFragment<T extends AbstractC5073bmE<V>, V extends InterfaceC9336dhn> extends BaseFragment implements InterfaceC9336dhn {
@BindView
public CommonInputViewGroup accountEditText;
@BindView
public ImageView bankLogo;
@BindView
public TextView bankName;
@BindView
public LinearLayout buttonsContainer;
private final float d = 1.0f;
private final int h = 1;
private String c = "";
public abstract void c(boolean z);
public abstract List<Button> d();
public abstract T h();
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
C14957gcv.e(layoutInflater, "");
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.2131559710, viewGroup, false);
ButterKnife.c(this, inflate);
for (Button button : d()) {
LinearLayout linearLayout = this.buttonsContainer;
if (linearLayout == null) {
C14957gcv.a("");
linearLayout = null;
}
linearLayout.addView(button);
}
return inflate;
}
@Override // o.InterfaceC9336dhn
public final void c(String str, String str2, String str3, String str4) {
C14957gcv.e(str, "");
C14957gcv.e(str2, "");
C13020fOa e = Picasso.d().e(str);
ImageView imageView = this.bankLogo;
CommonInputViewGroup commonInputViewGroup = null;
if (imageView == null) {
C14957gcv.a("");
imageView = null;
}
e.aBu_(imageView, null);
TextView textView = this.bankName;
if (textView == null) {
C14957gcv.a("");
textView = null;
}
textView.setText(str2);
CommonInputViewGroup commonInputViewGroup2 = this.accountEditText;
if (commonInputViewGroup2 == null) {
C14957gcv.a("");
commonInputViewGroup2 = null;
}
commonInputViewGroup2.setErrorText(getString(R.string.hml_business_operating_account_error));
CommonInputViewGroup commonInputViewGroup3 = this.accountEditText;
if (commonInputViewGroup3 == null) {
C14957gcv.a("");
commonInputViewGroup3 = null;
}
RVV rvv = new RVV(this);
commonInputViewGroup3.mEditText.addTextChangedListener(rvv);
commonInputViewGroup3.d.add(rvv);
if (str3 != null) {
CommonInputViewGroup commonInputViewGroup4 = this.accountEditText;
if (commonInputViewGroup4 != null) {
commonInputViewGroup = commonInputViewGroup4;
} else {
C14957gcv.a("");
}
commonInputViewGroup.setText(str3);
}
if (str4 != null) {
this.c = str4;
}
}
/* loaded from: classes5.dex */
public static final class RVV extends fJJ {
private HmlBaseOperatingAccountFragment<T, V> d;
RVV(HmlBaseOperatingAccountFragment<T, V> hmlBaseOperatingAccountFragment) {
this.d = hmlBaseOperatingAccountFragment;
}
@Override // o.fJJ, android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
final String str;
T h = this.d.h();
if (editable == null || (str = editable.toString()) == null) {
str = "";
}
C14957gcv.e(str, "");
h.a = str;
ZI.IeS ieS = new ZI.IeS(str) { // from class: o.bmD
private String d;
@Override // o.ZI.IeS
public final void e(Object obj) {
String str2 = this.d;
InterfaceC9336dhn interfaceC9336dhn = (InterfaceC9336dhn) obj;
C14957gcv.e(str2, "");
if (str2.length() > 0) {
interfaceC9336dhn.e();
} else {
interfaceC9336dhn.b();
}
}
{
this.d = str;
}
};
if (h.f != 0) {
ieS.e(h.f);
}
}
}
@Override // o.InterfaceC9336dhn
public final void b() {
CommonInputViewGroup commonInputViewGroup = this.accountEditText;
if (commonInputViewGroup == null) {
C14957gcv.a("");
commonInputViewGroup = null;
}
commonInputViewGroup.c();
c(false);
}
@Override // o.InterfaceC9336dhn
public final void e() {
CommonInputViewGroup commonInputViewGroup = this.accountEditText;
if (commonInputViewGroup == null) {
C14957gcv.a("");
commonInputViewGroup = null;
}
commonInputViewGroup.e();
c(true);
}
@Override // o.InterfaceC9336dhn
public final void d(C5045bld c5045bld, boolean z) {
C14957gcv.e(c5045bld, "");
Bundle bundle = new Bundle();
bundle.putParcelable("OPERATING_ACCOUNT_RESULT", c5045bld);
bundle.putBoolean("OPERATING_ACCOUNT_EDIT_ACTION", z);
if (getActivity() instanceof fHS) {
((fHS) getActivity()).ayB_(bundle);
}
}
/* JADX INFO: Access modifiers changed from: protected */
public final float g() {
return this.d;
}
}