341 lines
12 KiB
Java
341 lines
12 KiB
Java
package com.scb.phone.view.fragment.requesttopay;
|
|
|
|
import android.content.DialogInterface;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.text.Editable;
|
|
import android.text.TextUtils;
|
|
import android.text.TextWatcher;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.EditText;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import butterknife.BindView;
|
|
import butterknife.ButterKnife;
|
|
import butterknife.OnClick;
|
|
import com.google.android.material.textfield.TextInputLayout;
|
|
import com.scb.phone.R;
|
|
import com.scb.phone.view.activity.requesttopay.RequesterReviewActivity;
|
|
import com.scb.phone.view.adapter.transferandpay.PaybackPeriodAdapter;
|
|
import com.scb.phone.view.custom.common.AmountEditText;
|
|
import com.scb.phone.view.custom.common.CustomDialog;
|
|
import com.scb.phone.view.custom.common.DefaultButton;
|
|
import com.scb.phone.view.fragment.requesttopay.PromptPayTargetSelectFragment;
|
|
import java.util.List;
|
|
import o.BD;
|
|
import o.C10604eJ;
|
|
import o.C10829eQ;
|
|
import o.C1189Xo;
|
|
import o.C5973cEq;
|
|
import o.C6583cXR;
|
|
import o.InterfaceC12824fIT;
|
|
import o.InterfaceC13391fZD;
|
|
import o.InterfaceC8929daC;
|
|
import o.VL;
|
|
import o.VM;
|
|
import o.gjJ;
|
|
import o.pug;
|
|
import o.qwQ;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public class InputDetailsFragment extends Hilt_InputDetailsFragment implements InterfaceC12824fIT, PromptPayTargetSelectFragment.RVV, InterfaceC8929daC.HBt {
|
|
|
|
@BindView
|
|
protected DefaultButton buttonReview;
|
|
private boolean c;
|
|
|
|
@BindView
|
|
protected AmountEditText editAmount;
|
|
private PaybackPeriodAdapter f;
|
|
private PromptPayTargetSelectFragment g;
|
|
|
|
@BindView
|
|
protected RecyclerView paybackPeriodRecyclerView;
|
|
|
|
@InterfaceC13391fZD
|
|
public C5973cEq presenter;
|
|
|
|
@BindView
|
|
protected ImageView proxyNumberEditImageView;
|
|
|
|
@BindView
|
|
protected TextView proxyNumberRequestNameTextView;
|
|
|
|
@BindView
|
|
protected TextView proxyNumberRequestNumberTextView;
|
|
|
|
@BindView
|
|
protected ImageView proxyNumberTypeImageView;
|
|
|
|
@BindView
|
|
protected EditText rtpNoteEditText;
|
|
|
|
@BindView
|
|
protected TextView rtpNoteErrorTextView;
|
|
|
|
@BindView
|
|
protected TextInputLayout textInputAmount;
|
|
private double d = 0.0d;
|
|
private int h = -1;
|
|
|
|
public static InputDetailsFragment axv_(Intent intent) {
|
|
Bundle bundle = new Bundle();
|
|
if (intent.hasExtra("EXTRA_PROXY_NUMBER")) {
|
|
String stringExtra = intent.getStringExtra("EXTRA_PROXY_NUMBER");
|
|
String stringExtra2 = intent.getStringExtra("EXTRA_PROXY_NAME");
|
|
bundle.putString("BUNDLE_PROXY_NUMBER", stringExtra);
|
|
bundle.putString("BUNDLE_PROXY_NAME", stringExtra2);
|
|
bundle.putString("source", intent.getStringExtra("source"));
|
|
}
|
|
InputDetailsFragment inputDetailsFragment = new InputDetailsFragment();
|
|
inputDetailsFragment.setArguments(bundle);
|
|
return inputDetailsFragment;
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
|
String str;
|
|
String str2;
|
|
int i;
|
|
View inflate = layoutInflater.inflate(R.layout.2131559888, viewGroup, false);
|
|
ButterKnife.c(this, inflate);
|
|
super.aa();
|
|
Y();
|
|
u(getString(R.string.request_new_request));
|
|
Bundle arguments = getArguments();
|
|
if (arguments != null) {
|
|
str2 = arguments.getString("BUNDLE_PROXY_NUMBER");
|
|
str = arguments.getString("BUNDLE_PROXY_NAME");
|
|
} else {
|
|
str = "";
|
|
str2 = str;
|
|
}
|
|
if (str != null && !"".equals(str)) {
|
|
this.proxyNumberRequestNameTextView.setText(str);
|
|
} else {
|
|
this.proxyNumberRequestNameTextView.setVisibility(8);
|
|
}
|
|
if (str2 != null && !"".equals(str2)) {
|
|
if (str2.length() > 10) {
|
|
this.c = false;
|
|
i = R.drawable.icon_prompt_pay_cid;
|
|
} else {
|
|
this.c = true;
|
|
i = R.drawable.icon_prompt_pay_mobile;
|
|
}
|
|
this.proxyNumberRequestNumberTextView.setText((String) C6583cXR.c(new Object[]{false, Boolean.valueOf(this.c), str2}, -1092823629, 1092823630, (int) System.currentTimeMillis()));
|
|
this.proxyNumberRequestNumberTextView.requestFocus();
|
|
this.proxyNumberTypeImageView.setImageResource(i);
|
|
C5973cEq c5973cEq = this.presenter;
|
|
boolean z = this.c;
|
|
c5973cEq.h = str2;
|
|
c5973cEq.d = z;
|
|
}
|
|
this.rtpNoteEditText.addTextChangedListener(new TextWatcher(this) { // from class: com.scb.phone.view.fragment.requesttopay.InputDetailsFragment.4
|
|
private InputDetailsFragment e;
|
|
|
|
@Override // android.text.TextWatcher
|
|
public final void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
|
|
}
|
|
|
|
@Override // android.text.TextWatcher
|
|
public final void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
|
|
}
|
|
|
|
{
|
|
this.e = this;
|
|
}
|
|
|
|
@Override // android.text.TextWatcher
|
|
public final void afterTextChanged(Editable editable) {
|
|
this.e.rtpNoteErrorTextView.setVisibility(8);
|
|
}
|
|
});
|
|
this.editAmount.setOnAmountChangeListener(new AmountEditText.RVV(this) { // from class: com.scb.phone.view.fragment.requesttopay.InputDetailsFragment.1
|
|
private InputDetailsFragment c;
|
|
|
|
{
|
|
this.c = this;
|
|
}
|
|
|
|
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
|
|
public final void b(double d) {
|
|
InputDetailsFragment.e(this.c, d);
|
|
}
|
|
|
|
@Override // com.scb.phone.view.custom.common.AmountEditText.RVV
|
|
public final void a() {
|
|
this.c.aN_();
|
|
}
|
|
});
|
|
c("rtp_input", new pug("source", Q()), new pug("subtype", "outgoing"));
|
|
PromptPayTargetSelectFragment promptPayTargetSelectFragment = (PromptPayTargetSelectFragment) getChildFragmentManager().findFragmentByTag(getString(R.string.transfer_tab));
|
|
this.g = promptPayTargetSelectFragment;
|
|
promptPayTargetSelectFragment.c = this;
|
|
C5973cEq c5973cEq2 = this.presenter;
|
|
PromptPayTargetSelectFragment promptPayTargetSelectFragment2 = this.g;
|
|
c5973cEq2.e((C5973cEq) this);
|
|
c5973cEq2.a = this;
|
|
c5973cEq2.f8601o = promptPayTargetSelectFragment2;
|
|
return inflate;
|
|
}
|
|
|
|
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
|
|
public void onActivityCreated(Bundle bundle) {
|
|
super.onActivityCreated(bundle);
|
|
C5973cEq c5973cEq = this.presenter;
|
|
c5973cEq.n.e.d("TRANSFER");
|
|
c5973cEq.n.d();
|
|
qwQ qwq = c5973cEq.n;
|
|
qwq.d(qwq.i, new C5973cEq.RVV(c5973cEq, (byte) 0));
|
|
}
|
|
|
|
@OnClick
|
|
public void onProxyNumberEditClick() {
|
|
getActivity().finish();
|
|
}
|
|
|
|
@Override // com.scb.phone.view.fragment.BaseFragment
|
|
public final void aa() {
|
|
super.aa();
|
|
Y();
|
|
u(getString(R.string.request_new_request));
|
|
}
|
|
|
|
@OnClick
|
|
public void onReviewButtonClick() {
|
|
String str;
|
|
String str2;
|
|
String str3;
|
|
byte b = 0;
|
|
this.buttonReview.setButtonEnabled(false);
|
|
C5973cEq c5973cEq = this.presenter;
|
|
String obj = this.rtpNoteEditText.getText().toString();
|
|
c5973cEq.i = obj;
|
|
double d = c5973cEq.e;
|
|
boolean z = d > 0.0d && d <= ((double) c5973cEq.c.c);
|
|
boolean z2 = obj == null || TextUtils.isEmpty(obj) || ((Boolean) C6583cXR.c(new Object[]{obj}, -1032102340, 1032102340, (int) System.currentTimeMillis())).booleanValue();
|
|
if (!z || !z2) {
|
|
if (!z) {
|
|
InterfaceC8929daC.HBt hBt = c5973cEq.a;
|
|
BD bd = c5973cEq.g;
|
|
hBt.e(BD.a(c5973cEq.c.c));
|
|
return;
|
|
}
|
|
c5973cEq.a.d();
|
|
return;
|
|
}
|
|
if (c5973cEq.f != 0) {
|
|
c5973cEq.f.y();
|
|
}
|
|
if (c5973cEq.b) {
|
|
return;
|
|
}
|
|
c5973cEq.b = true;
|
|
VL vl = c5973cEq.k;
|
|
if (vl != null) {
|
|
str = vl.e;
|
|
str2 = c5973cEq.k.c;
|
|
str3 = c5973cEq.k.g;
|
|
} else {
|
|
str = "";
|
|
str2 = str;
|
|
str3 = str2;
|
|
}
|
|
C10829eQ e = C10829eQ.e();
|
|
e.b = String.valueOf(c5973cEq.e);
|
|
e.d = str;
|
|
C10604eJ b2 = C10604eJ.b();
|
|
b2.d = c5973cEq.m.b;
|
|
e.c = b2;
|
|
String str4 = c5973cEq.i;
|
|
e.e = str4 != null ? str4 : "";
|
|
e.a = C6583cXR.v(str2);
|
|
e.g = str3;
|
|
e.j = c5973cEq.h;
|
|
e.i = c5973cEq.d ? "MOB" : "CID";
|
|
c5973cEq.n.b(e);
|
|
qwQ qwq = c5973cEq.n;
|
|
qwq.d(qwq.i, new C5973cEq.IeS(c5973cEq, b));
|
|
}
|
|
|
|
@Override // o.InterfaceC8929daC.HBt
|
|
public final void b(List<VM> list) {
|
|
this.paybackPeriodRecyclerView.setVisibility(0);
|
|
getContext();
|
|
this.paybackPeriodRecyclerView.setLayoutManager(new LinearLayoutManager(0, false));
|
|
PaybackPeriodAdapter paybackPeriodAdapter = new PaybackPeriodAdapter(list);
|
|
this.f = paybackPeriodAdapter;
|
|
paybackPeriodAdapter.e = this;
|
|
this.paybackPeriodRecyclerView.setAdapter(this.f);
|
|
}
|
|
|
|
@Override // o.InterfaceC8929daC.HBt
|
|
public final void b(boolean z) {
|
|
this.buttonReview.setButtonEnabled(z);
|
|
}
|
|
|
|
@Override // o.InterfaceC8929daC.HBt
|
|
public final void c(C1189Xo c1189Xo) {
|
|
this.presenter.d(this.d, this.h);
|
|
Intent intent = new Intent(getContext(), (Class<?>) RequesterReviewActivity.class);
|
|
intent.putExtra("com.scb.phone.EXTRA_REVIEW", c1189Xo);
|
|
intent.putExtra("source", Q());
|
|
startActivity(intent);
|
|
}
|
|
|
|
@Override // o.InterfaceC8929daC.HBt
|
|
public final void d() {
|
|
this.presenter.d(this.d, this.h);
|
|
this.rtpNoteErrorTextView.setVisibility(0);
|
|
}
|
|
|
|
@Override // o.InterfaceC8929daC.HBt
|
|
public final void e(String str) {
|
|
CustomDialog b = CustomDialog.b(getContext());
|
|
String string = getString(R.string.common_error);
|
|
if (gjJ.a(string)) {
|
|
b.mTitleTextView.setVisibility(0);
|
|
b.mTitleTextView.setText(string);
|
|
}
|
|
String format = String.format(getString(R.string.request_to_pay_amount_over_limit_error_message), str);
|
|
if (gjJ.a(format)) {
|
|
b.mTextTextView.setVisibility(0);
|
|
b.mTextTextView.setText(format);
|
|
}
|
|
b.aoU_(getString(R.string.ok), new DialogInterface.OnClickListener() { // from class: o.fzs
|
|
@Override // android.content.DialogInterface.OnClickListener
|
|
public final void onClick(DialogInterface dialogInterface, int i) {
|
|
dialogInterface.dismiss();
|
|
}
|
|
}).show();
|
|
this.presenter.d(this.d, this.h);
|
|
}
|
|
|
|
@Override // o.InterfaceC12824fIT
|
|
public final void a(int i) {
|
|
PaybackPeriodAdapter paybackPeriodAdapter = this.f;
|
|
paybackPeriodAdapter.b = i;
|
|
paybackPeriodAdapter.notifyDataSetChanged();
|
|
this.h = i;
|
|
C5973cEq c5973cEq = this.presenter;
|
|
PaybackPeriodAdapter paybackPeriodAdapter2 = this.f;
|
|
c5973cEq.m = paybackPeriodAdapter2.a.get(paybackPeriodAdapter2.b);
|
|
this.presenter.d(this.d, i);
|
|
}
|
|
|
|
static /* synthetic */ void e(InputDetailsFragment inputDetailsFragment, double d) {
|
|
inputDetailsFragment.d = d;
|
|
inputDetailsFragment.presenter.d(d, inputDetailsFragment.h);
|
|
}
|
|
|
|
@Override // com.scb.phone.view.fragment.requesttopay.PromptPayTargetSelectFragment.RVV
|
|
public final void c(VL vl) {
|
|
this.presenter.k = vl;
|
|
}
|
|
}
|