package com.scb.phone.view.custom.profilemanagement; import android.content.Context; import android.text.InputFilter; import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import butterknife.BindView; import butterknife.ButterKnife; import com.scb.phone.R; import com.scb.phone.view.custom.common.CustomNoteEditText; import com.scb.phone.view.custom.common.DefaultButton; import com.scb.phone.view.custom.profilemanagement.AccountManagementItemCustomView; import o.C12402exY; import o.C12919fLP; import o.C6583cXR; import o.UU; import o.UV; import o.fKS; import o.nMh; /* loaded from: classes5.dex */ public class AccountManagementItemCustomView extends AccountManagementItem { @BindView TextView accountNicknameText; @BindView TextView accountNoText; @BindView TextView accountTypeText; private C12402exY.RVV d; @BindView ImageView deleteButton; @BindView ImageView deleteSCBSButton; @BindView DefaultButton doneButton; private UU e; @BindView ImageView editButton; @BindView View editButtons; @BindView ImageButton editClearButton; @BindView View editField; @BindView CustomNoteEditText editText; @BindView TextView mErrorText; @BindView View separator; public AccountManagementItemCustomView(Context context) { this(context, null); } public AccountManagementItemCustomView(Context context, AttributeSet attributeSet) { this(context, attributeSet, 0); } public AccountManagementItemCustomView(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); ((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131558898, (ViewGroup) this, true); setBackgroundColor(nMh.getColor(getContext(), R.color.f14042131100912)); ButterKnife.c(this); this.mErrorText.setVisibility(8); this.editText.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_gray_rounded_rectangle)); this.editButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.eDM private AccountManagementItemCustomView d; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.d.b(true); } { this.d = this; } }); this.doneButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.eDQ private AccountManagementItemCustomView a; @Override // android.view.View.OnClickListener public final void onClick(View view) { AccountManagementItemCustomView.b(this.a); } { this.a = this; } }); this.editClearButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.eDP private AccountManagementItemCustomView e; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.e.editText.setText(""); } { this.e = this; } }); this.deleteButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.eDO private AccountManagementItemCustomView a; @Override // android.view.View.OnClickListener public final void onClick(View view) { AccountManagementItemCustomView.f(this.a); } { this.a = this; } }); this.deleteSCBSButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.eDR private AccountManagementItemCustomView b; @Override // android.view.View.OnClickListener public final void onClick(View view) { AccountManagementItemCustomView.d(this.b); } { this.b = this; } }); this.editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(20), new C12919fLP("[^\\u200b]")}); this.editText.addTextChangedListener(new fKS.AnonymousClass2(new fKS.RVV(this) { // from class: o.eDS private AccountManagementItemCustomView a; @Override // o.fKS.RVV public final void e(String str) { this.a.a(str); } { this.a = this; } })); } @Override // com.scb.phone.view.custom.profilemanagement.AccountManagementItem public void setDisplay(final UV uv, boolean z) { this.e = (UU) uv; Runnable runnable = new Runnable(this) { // from class: o.eDT private AccountManagementItemCustomView b; @Override // java.lang.Runnable public final void run() { r0.accountTypeText.setText(this.b.getContext().getString(com.scb.phone.R.string.account_management_scbs_label)); } { this.b = this; } }; Runnable runnable2 = new Runnable(this, uv) { // from class: o.eDW private AccountManagementItemCustomView a; private UV b; @Override // java.lang.Runnable public final void run() { AccountManagementItemCustomView.b(this.a, this.b); } { this.a = this; this.b = uv; } }; if (this.e.i) { this.editButton.setVisibility(8); this.accountNoText.setVisibility(8); this.accountNicknameText.setVisibility(8); this.deleteButton.setVisibility(8); this.deleteSCBSButton.setVisibility(z ? 4 : 0); runnable.run(); return; } runnable2.run(); this.editButton.setVisibility(0); this.accountNoText.setVisibility(0); this.accountNicknameText.setVisibility(0); this.deleteButton.setVisibility(z ? 8 : 0); } /* JADX INFO: Access modifiers changed from: private */ public boolean a(String str) { boolean z = TextUtils.isEmpty(str) || ((Boolean) C6583cXR.c(new Object[]{str}, -1032102340, 1032102340, (int) System.currentTimeMillis())).booleanValue(); if (z) { this.mErrorText.setVisibility(8); this.editText.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_gray_rounded_rectangle)); } else { this.mErrorText.setVisibility(0); this.editText.setBackground(nMh.getDrawable(getContext(), R.drawable.shape_red_reounded_reactangle_border)); } this.doneButton.setButtonEnabled(z); return z; } public static /* synthetic */ void b(AccountManagementItemCustomView accountManagementItemCustomView) { C12402exY.RVV rvv; if (!accountManagementItemCustomView.a(accountManagementItemCustomView.editText.getText().toString()) || (rvv = accountManagementItemCustomView.d) == null) { return; } rvv.e(accountManagementItemCustomView.e, accountManagementItemCustomView.editText.getText().toString()); } public static /* synthetic */ void d(AccountManagementItemCustomView accountManagementItemCustomView) { C12402exY.RVV rvv = accountManagementItemCustomView.d; if (rvv != null) { rvv.a(accountManagementItemCustomView.e); } } public static /* synthetic */ void f(AccountManagementItemCustomView accountManagementItemCustomView) { C12402exY.RVV rvv = accountManagementItemCustomView.d; if (rvv != null) { rvv.a(accountManagementItemCustomView.e); } } public static /* synthetic */ void b(AccountManagementItemCustomView accountManagementItemCustomView, UV uv) { accountManagementItemCustomView.accountNicknameText.setText(accountManagementItemCustomView.e.b.isEmpty() ? accountManagementItemCustomView.getContext().getString(R.string.account_management_nickname_placeholder) : accountManagementItemCustomView.e.b); accountManagementItemCustomView.accountNoText.setText(accountManagementItemCustomView.e.m); accountManagementItemCustomView.accountTypeText.setText(accountManagementItemCustomView.e.a); accountManagementItemCustomView.separator.setVisibility(uv.r ? 8 : 0); accountManagementItemCustomView.b(accountManagementItemCustomView.e.l); accountManagementItemCustomView.editText.setHint(accountManagementItemCustomView.getContext().getString(R.string.account_management_nickname_placeholder)); } /* JADX INFO: Access modifiers changed from: private */ public void b(boolean z) { this.e.l = z; this.editButtons.setVisibility(!z ? 0 : 8); this.editField.setVisibility(z ? 0 : 8); if (z) { this.d.d(this.e); if (this.e.b != null && !this.e.b.isEmpty()) { this.editText.setText(this.e.b); } else { this.editText.setText(""); } } } public void setListener(C12402exY.RVV rvv) { this.d = rvv; } }