what-the-bank/sources/com/scb/phone/view/fragment/promptpay/PromptPayQRInputFragment.java

161 lines
5.3 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.fragment.promptpay;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.scb.phone.R;
import com.scb.phone.view.activity.BaseActivity;
import com.scb.phone.view.activity.promptpay.PromptPayQRActivity;
import com.scb.phone.view.adapter.promptpay.PromptPayMobileListAdapter;
import com.scb.phone.view.custom.common.AmountEditText;
import com.scb.phone.view.custom.common.DefaultButton;
import o.C1082Ve;
import o.C1087Vh;
import o.C11476eg;
import o.C15602gz;
import o.C7874cwa;
import o.InterfaceC13391fZD;
import o.InterfaceC8975daw;
import o.ZI;
import o.ihb;
/* loaded from: classes5.dex */
public class PromptPayQRInputFragment extends Hilt_PromptPayQRInputFragment implements InterfaceC8975daw.LWm, PromptPayMobileListAdapter.RVV {
private PromptPayMobileListAdapter c;
@BindView
DefaultButton createQRCodeButton;
private double d = 0.0d;
@BindView
AmountEditText editAmount;
private String g;
private String j;
@BindView
RecyclerView mobileListRecyclerView;
@InterfaceC13391fZD
public C7874cwa promptPayQRInputPresenter;
public static PromptPayQRInputFragment f() {
return new PromptPayQRInputFragment();
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
byte b = 0;
View inflate = layoutInflater.inflate(R.layout.2131559838, viewGroup, false);
ButterKnife.c(this, inflate);
this.promptPayQRInputPresenter.e((C7874cwa) this);
C7874cwa c7874cwa = this.promptPayQRInputPresenter;
if (!c7874cwa.d) {
c7874cwa.d = true;
ZI.IeS ieS = new ZI.IeS() { // from class: o.cwe
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC8975daw.LWm) obj).y();
}
};
if (c7874cwa.f != 0) {
ieS.e(c7874cwa.f);
}
c7874cwa.b.b();
ihb ihbVar = c7874cwa.b;
ihbVar.d(ihbVar.i, new C7874cwa.Sts(c7874cwa, b));
}
this.createQRCodeButton.setButtonEnabled(false);
this.editAmount.setOnAmountChangeListener(new AmountEditText.RVV(this) { // from class: com.scb.phone.view.fragment.promptpay.PromptPayQRInputFragment.4
private PromptPayQRInputFragment e;
{
this.e = this;
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void b(double d) {
this.e.d = d;
}
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
public final void a() {
this.e.aN_();
}
});
this.editAmount.setMaximumDecimalDigit(9);
return inflate;
}
@Override // o.InterfaceC8975daw.LWm
public final void c() {
this.createQRCodeButton.setButtonEnabled(true);
}
@Override // o.InterfaceC8975daw.LWm
public final void d() {
if (getActivity() != null) {
((PromptPayQRActivity) getActivity()).g();
}
}
@OnClick
public void createQRCodeButton() {
byte b = 0;
this.createQRCodeButton.setButtonEnabled(false);
C7874cwa c7874cwa = this.promptPayQRInputPresenter;
String str = this.j;
String str2 = this.g;
Double valueOf = Double.valueOf(this.d);
if (c7874cwa.f != 0) {
c7874cwa.f.y();
}
C11476eg b2 = C11476eg.b();
b2.c = str;
b2.e = str2;
b2.b = C15602gz.e(valueOf.doubleValue());
c7874cwa.b.d(b2);
ihb ihbVar = c7874cwa.b;
ihbVar.d(ihbVar.i, new C7874cwa.LWm(c7874cwa, b));
}
@Override // com.scb.phone.view.adapter.promptpay.PromptPayMobileListAdapter.RVV
public final void c(C1087Vh c1087Vh, boolean z) {
if (this.c != null) {
this.j = c1087Vh.j;
this.g = c1087Vh.g;
if (!z) {
this.c.notifyDataSetChanged();
}
if (this.createQRCodeButton.isEnabled()) {
return;
}
this.createQRCodeButton.setButtonEnabled(true);
}
}
@Override // o.InterfaceC8975daw.LWm
public final void b(C1082Ve c1082Ve) {
if (c1082Ve != null) {
if (c1082Ve.c != null) {
this.editAmount.setFormattedAmount(c1082Ve.c.b);
}
getContext();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(1, false);
PromptPayMobileListAdapter promptPayMobileListAdapter = new PromptPayMobileListAdapter(c1082Ve.b);
this.c = promptPayMobileListAdapter;
promptPayMobileListAdapter.d = this;
this.mobileListRecyclerView.setLayoutManager(linearLayoutManager);
this.mobileListRecyclerView.setAdapter(this.c);
if (getActivity() != null) {
((BaseActivity) getActivity()).ar_();
}
}
}
}