what-the-bank/sources/com/scb/phone/view/fragment/bulktransfer/ManageRecipientGroupFragmen...

464 lines
16 KiB
Java

package com.scb.phone.view.fragment.bulktransfer;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.core.view.ViewCompat;
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.bulktransfer.AddNewRecipientActivity;
import com.scb.phone.view.activity.bulktransfer.EditRecipientActivity;
import com.scb.phone.view.activity.bulktransfer.SelectRecipientFromFavouriteActivity;
import com.scb.phone.view.adapter.bulktransfer.ManageGroupAdapter;
import com.scb.phone.view.custom.common.CustomDialog;
import com.scb.phone.view.custom.common.CustomInputDialog;
import com.scb.phone.view.custom.common.DefaultButton;
import com.scb.phone.view.fragment.bulktransfer.ManageRecipientGroupFragment;
import o.C10457eEr;
import o.C2815ali;
import o.C4836bhg;
import o.C6583cXR;
import o.FP;
import o.FV;
import o.InterfaceC13391fZD;
import o.InterfaceC6636cYn;
import o.TPw;
import o.ZI;
import o.eBM;
import o.fSJ;
import o.fSQ;
import o.gjJ;
import o.glR;
import o.iNh;
/* loaded from: classes5.dex */
public class ManageRecipientGroupFragment extends Hilt_ManageRecipientGroupFragment implements InterfaceC6636cYn.ZqN {
@BindView
DefaultButton buttonAddFromFavourite;
@BindView
DefaultButton buttonAddNewRecipient;
private CustomInputDialog c;
@BindView
TextView counterRecipients;
private fSJ d;
@BindView
TextView groupName;
@InterfaceC13391fZD
public C2815ali manageRecipientGroupPresenter;
@BindView
TextView recipientsNumber;
@BindView
RecyclerView recipientsRecycler;
public static ManageRecipientGroupFragment a(String str, String str2) {
ManageRecipientGroupFragment manageRecipientGroupFragment = new ManageRecipientGroupFragment();
Bundle bundle = new Bundle();
bundle.putString("com.scb.phone.EXTRA_GROUP_ID", str);
bundle.putString("com.scb.phone.EXTRA_PARENT_BROADCAST", str2);
manageRecipientGroupFragment.setArguments(bundle);
return manageRecipientGroupFragment;
}
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
View inflate = layoutInflater.inflate(R.layout.2131559753, viewGroup, false);
ButterKnife.c(this, inflate);
this.manageRecipientGroupPresenter.e((C2815ali) this);
C2815ali c2815ali = this.manageRecipientGroupPresenter;
String string = getArguments().getString("com.scb.phone.EXTRA_GROUP_ID");
String W = W();
c2815ali.e = string;
c2815ali.a(W);
this.d = glR.Ge_(getContext(), new IntentFilter("com.scb.phone/BROADCAST_RELOAD_MANAGE_RECIPIENTS_GROUP_BULK_TRANSFER")).subscribe(new fSQ(this) { // from class: o.eIq
private ManageRecipientGroupFragment d;
@Override // o.fSQ
public final void c(Object obj) {
r0.manageRecipientGroupPresenter.a(this.d.W());
}
{
this.d = this;
}
}, new fSQ() { // from class: o.eIo
@Override // o.fSQ
public final void c(Object obj) {
guQ.a((Throwable) obj);
}
});
return inflate;
}
@Override // com.scb.phone.view.fragment.BaseFragment, androidx.fragment.app.Fragment
public void onDestroy() {
super.onDestroy();
this.manageRecipientGroupPresenter.w_();
fSJ fsj = this.d;
if (fsj != null && !fsj.isDisposed()) {
this.d.dispose();
}
Bundle arguments = getArguments();
if (arguments != null) {
C10457eEr.aqd_(this, new Intent(arguments.getString("com.scb.phone.EXTRA_PARENT_BROADCAST")));
}
}
@Override // o.InterfaceC6636cYn.ZqN
public final void b(String str) {
CustomInputDialog b = CustomInputDialog.b(getContext());
this.c = b;
b.mEditTextView.setFilters(new InputFilter[]{new InputFilter.LengthFilter(20)});
this.c.mEditTextView.addTextChangedListener(new TextWatcher(this) { // from class: com.scb.phone.view.fragment.bulktransfer.ManageRecipientGroupFragment.5
private ManageRecipientGroupFragment d;
@Override // android.text.TextWatcher
public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
{
this.d = this;
}
@Override // android.text.TextWatcher
public final void afterTextChanged(Editable editable) {
this.d.c.mErrorTextView.setVisibility(8);
}
});
this.c.c();
CustomInputDialog customInputDialog = this.c;
String string = getString(R.string.group_name);
if (string != null) {
customInputDialog.mTitleTextView.setVisibility(0);
customInputDialog.mTitleTextView.setText(string);
}
this.c.setCanceledOnTouchOutside(false);
this.c.c(str);
this.c.apc_(R.string.cancel, new DialogInterface.OnClickListener() { // from class: o.eIn
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
CustomInputDialog customInputDialog2 = this.c;
String string2 = getString(R.string.edit_favourite);
DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener(this) { // from class: o.eIr
private ManageRecipientGroupFragment d;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
ManageRecipientGroupFragment.b(this.d);
}
{
this.d = this;
}
};
if (string2 != null) {
customInputDialog2.mPositiveButton.setText(string2);
customInputDialog2.mPositiveButton.setOnClickListener(new eBM(customInputDialog2, onClickListener, false));
}
customInputDialog2.show();
}
@Override // o.InterfaceC6636cYn.ZqN
public final void d(String str, boolean z) {
CustomDialog b = CustomDialog.b(getContext());
String string = getString(R.string.delete_recipients_group, str);
if (gjJ.a(string)) {
b.mTitleTextView.setVisibility(0);
b.mTitleTextView.setText(string);
}
((CustomDialog) CustomDialog.e(new Object[]{b.d(z ? R.string.are_you_sure_want_delete_scheduled_group : R.string.are_you_sure_want_delete_group).aoT_(R.string.confirm_delete_group, new DialogInterface.OnClickListener(this) { // from class: o.eIk
private ManageRecipientGroupFragment e;
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
ManageRecipientGroupFragment.e(this.e);
}
{
this.e = this;
}
}), Integer.valueOf(R.string.cancel_delete_group), new DialogInterface.OnClickListener() { // from class: o.eIi
@Override // android.content.DialogInterface.OnClickListener
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}})).show();
}
@Override // o.InterfaceC6636cYn.ZqN
public final void e(String str, int i) {
SelectRecipientFromFavouriteActivity.e(getContext(), str, i);
}
@Override // o.InterfaceC6636cYn.ZqN
public final void c(String str) {
AddNewRecipientActivity.d(getContext(), str);
}
@Override // o.InterfaceC6636cYn.ZqN
public final void a() {
getActivity().finish();
C10457eEr.aqd_(this, new Intent("com.scb.phone/BROADCAST_GROUP_DELETED_BULK_TRANSFER"));
}
@Override // o.InterfaceC6636cYn.ZqN
public final void e(String str) {
this.groupName.setText(str);
CustomInputDialog customInputDialog = this.c;
if (customInputDialog != null) {
customInputDialog.dismiss();
}
}
@Override // o.InterfaceC6636cYn.ZqN
public final void c() {
CustomInputDialog customInputDialog = this.c;
if (customInputDialog != null) {
customInputDialog.dismiss();
}
}
@Override // o.InterfaceC6636cYn.ZqN
public final void c(FV fv, String str) {
EditRecipientActivity.c(getContext(), str, fv);
}
@Override // com.scb.phone.view.fragment.BaseFragment, android.content.DialogInterface.OnDismissListener
public void onDismiss(DialogInterface dialogInterface) {
super.onDismiss(dialogInterface);
this.manageRecipientGroupPresenter.b = false;
}
public static /* synthetic */ void a(ManageRecipientGroupFragment manageRecipientGroupFragment, final FV fv) {
final C2815ali c2815ali = manageRecipientGroupFragment.manageRecipientGroupPresenter;
ZI.IeS ieS = new ZI.IeS(c2815ali, fv) { // from class: o.alq
private C2815ali a;
private FV e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2815ali.b(this.a, this.e, (InterfaceC6636cYn.ZqN) obj);
}
{
this.a = c2815ali;
this.e = fv;
}
};
if (c2815ali.f != 0) {
ieS.e(c2815ali.f);
}
}
public static /* synthetic */ void e(ManageRecipientGroupFragment manageRecipientGroupFragment) {
C2815ali c2815ali = manageRecipientGroupFragment.manageRecipientGroupPresenter;
if (c2815ali.b) {
return;
}
c2815ali.b = true;
if (c2815ali.f != 0) {
c2815ali.f.y();
}
TPw e = TPw.e();
String str = c2815ali.e;
if (str == null) {
str = "";
}
e.c = str;
c2815ali.c.b(e);
iNh inh = c2815ali.c;
inh.d(inh.i, new C2815ali.IeS(c2815ali, (byte) 0));
}
public static /* synthetic */ void b(ManageRecipientGroupFragment manageRecipientGroupFragment) {
if (String.valueOf(manageRecipientGroupFragment.c.mEditTextView.getText()) != null) {
if (String.valueOf(manageRecipientGroupFragment.c.mEditTextView.getText()).length() > 0) {
if (!((Boolean) C6583cXR.c(new Object[]{String.valueOf(manageRecipientGroupFragment.c.mEditTextView.getText())}, -1032102340, 1032102340, (int) System.currentTimeMillis())).booleanValue()) {
CustomInputDialog customInputDialog = manageRecipientGroupFragment.c;
String string = manageRecipientGroupFragment.getString(R.string.favorite_invalid_character);
customInputDialog.mErrorTextView.setVisibility(0);
customInputDialog.mErrorTextView.setText(string);
return;
}
C2815ali c2815ali = manageRecipientGroupFragment.manageRecipientGroupPresenter;
String valueOf = String.valueOf(manageRecipientGroupFragment.c.mEditTextView.getText());
if (c2815ali.b) {
return;
}
c2815ali.b = true;
if (c2815ali.f != 0) {
c2815ali.f.y();
}
C4836bhg a = C4836bhg.a();
String str = c2815ali.e;
if (str == null) {
str = "";
}
a.b = str;
a.d = valueOf;
c2815ali.c.a(a);
iNh inh = c2815ali.c;
inh.d(inh.i, new C2815ali.LWm(c2815ali, valueOf));
return;
}
CustomInputDialog customInputDialog2 = manageRecipientGroupFragment.c;
String string2 = manageRecipientGroupFragment.getString(R.string.edit_favourite_empty);
customInputDialog2.mErrorTextView.setVisibility(0);
customInputDialog2.mErrorTextView.setText(string2);
}
}
@Override // o.InterfaceC6636cYn.ZqN
public final void d() {
getActivity().finish();
C10457eEr.aqd_(this, new Intent("com.scb.phone/BROADCAST_GROUP_DELETED_BULK_TRANSFER"));
}
@OnClick
public void onAddFromFavourite() {
final C2815ali c2815ali = this.manageRecipientGroupPresenter;
ZI.IeS ieS = new ZI.IeS(c2815ali) { // from class: o.alp
private C2815ali c;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2815ali.d(this.c, (InterfaceC6636cYn.ZqN) obj);
}
{
this.c = c2815ali;
}
};
if (c2815ali.f != 0) {
ieS.e(c2815ali.f);
}
}
@OnClick
public void onAddNewRecipient() {
final C2815ali c2815ali = this.manageRecipientGroupPresenter;
ZI.IeS ieS = new ZI.IeS(c2815ali) { // from class: o.alr
private C2815ali e;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2815ali.a(this.e, (InterfaceC6636cYn.ZqN) obj);
}
{
this.e = c2815ali;
}
};
if (c2815ali.f != 0) {
ieS.e(c2815ali.f);
}
}
@OnClick
public void onDelete() {
final C2815ali c2815ali = this.manageRecipientGroupPresenter;
ZI.IeS ieS = new ZI.IeS(c2815ali) { // from class: o.all
private C2815ali a;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2815ali.b(this.a, (InterfaceC6636cYn.ZqN) obj);
}
{
this.a = c2815ali;
}
};
if (c2815ali.f != 0) {
ieS.e(c2815ali.f);
}
}
@OnClick
public void onDone() {
C2815ali c2815ali = this.manageRecipientGroupPresenter;
ZI.IeS ieS = new ZI.IeS() { // from class: o.alo
@Override // o.ZI.IeS
public final void e(Object obj) {
((InterfaceC6636cYn.ZqN) obj).d();
}
};
if (c2815ali.f != 0) {
ieS.e(c2815ali.f);
}
}
@Override // o.InterfaceC6636cYn.ZqN
public final void a(FP fp) {
this.groupName.setText(fp.d);
this.counterRecipients.setText(fp.f);
this.buttonAddFromFavourite.setButtonEnabled(!fp.h);
this.buttonAddNewRecipient.setButtonEnabled(!fp.h);
}
@Override // o.InterfaceC6636cYn.ZqN
public final void c(FP fp) {
this.recipientsNumber.setText(fp.j);
getContext();
this.recipientsRecycler.setLayoutManager(new LinearLayoutManager(1, false));
ViewCompat.d((View) this.recipientsRecycler, false);
this.recipientsRecycler.setAdapter(new ManageGroupAdapter(fp.g, new ManageGroupAdapter.HBt(this) { // from class: o.eIp
private ManageRecipientGroupFragment e;
@Override // com.scb.phone.view.adapter.bulktransfer.ManageGroupAdapter.HBt
public final void c(FV fv) {
ManageRecipientGroupFragment.a(this.e, fv);
}
{
this.e = this;
}
}));
}
@OnClick
public void onEdit() {
final C2815ali c2815ali = this.manageRecipientGroupPresenter;
ZI.IeS ieS = new ZI.IeS(c2815ali) { // from class: o.aln
private C2815ali c;
@Override // o.ZI.IeS
public final void e(Object obj) {
C2815ali.c(this.c, (InterfaceC6636cYn.ZqN) obj);
}
{
this.c = c2815ali;
}
};
if (c2815ali.f != 0) {
ieS.e(c2815ali.f);
}
}
}