package com.scb.phone.view.custom.profilemanagement; import android.content.Context; import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageButton; import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; 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.AddedAccountManagementSuccessItemCustomView; import o.C12399exV; import o.C6583cXR; import o.InterfaceC10440eEa; import o.UU; import o.UV; import o.fKS; import o.nMh; /* loaded from: classes5.dex */ public class AddedAccountManagementSuccessItemCustomView extends ConstraintLayout implements InterfaceC10440eEa { @BindView TextView accountNicknameText; @BindView TextView accountNoText; @BindView TextView accountTypeText; private C12399exV.Sts c; private UU d; @BindView DefaultButton doneButton; @BindView Button editButton; @BindView ImageButton editClearButton; @BindView CustomNoteEditText editText; @BindView TextView mErrorText; public AddedAccountManagementSuccessItemCustomView(Context context) { this(context, null); } public AddedAccountManagementSuccessItemCustomView(Context context, AttributeSet attributeSet) { this(context, attributeSet, 0); } public AddedAccountManagementSuccessItemCustomView(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); ((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131558899, (ViewGroup) this, true); setBackgroundColor(nMh.getColor(context, 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.eDY private AddedAccountManagementSuccessItemCustomView a; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.a.b(true); } { this.a = this; } }); this.doneButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.eEc private AddedAccountManagementSuccessItemCustomView a; @Override // android.view.View.OnClickListener public final void onClick(View view) { AddedAccountManagementSuccessItemCustomView.e(this.a); } { this.a = this; } }); this.editClearButton.setOnClickListener(new View.OnClickListener(this) { // from class: o.eDZ private AddedAccountManagementSuccessItemCustomView d; @Override // android.view.View.OnClickListener public final void onClick(View view) { this.d.editText.setText(""); } { this.d = this; } }); this.editText.addTextChangedListener(new fKS.AnonymousClass2(new fKS.RVV(this) { // from class: o.eEb private AddedAccountManagementSuccessItemCustomView e; @Override // o.fKS.RVV public final void e(String str) { this.e.b(str); } { this.e = this; } })); b(false); } @Override // o.InterfaceC10440eEa public void setDisplay(UV uv) { UU uu = (UU) uv; this.d = uu; this.accountNicknameText.setText(uu.b); this.accountNoText.setText(this.d.m); this.accountTypeText.setText(this.d.a); this.editText.setHint(this.d.b); b(this.d.l); this.accountNicknameText.setVisibility(TextUtils.isEmpty(this.d.b) ^ true ? 0 : 8); this.editText.setHint(getContext().getString(R.string.account_management_nickname_placeholder)); } /* JADX INFO: Access modifiers changed from: private */ public boolean b(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; } /* JADX INFO: Access modifiers changed from: private */ public void b(boolean z) { this.accountNicknameText.setVisibility(!z ? 0 : 8); this.editButton.setVisibility(!z ? 0 : 4); this.editText.setVisibility(z ? 0 : 8); this.editClearButton.setVisibility(z ? 0 : 8); this.doneButton.setVisibility(z ? 0 : 8); UU uu = this.d; if (uu != null) { uu.l = z; if (z) { this.c.a(this.d); this.editText.setText(this.d.b); } } } public static /* synthetic */ void e(AddedAccountManagementSuccessItemCustomView addedAccountManagementSuccessItemCustomView) { if (addedAccountManagementSuccessItemCustomView.b(addedAccountManagementSuccessItemCustomView.editText.getText().toString())) { C12399exV.Sts sts = addedAccountManagementSuccessItemCustomView.c; if (sts != null) { sts.c(addedAccountManagementSuccessItemCustomView.d, addedAccountManagementSuccessItemCustomView.editText.getText().toString()); } addedAccountManagementSuccessItemCustomView.b(false); } } public void setListener(C12399exV.Sts sts) { this.c = sts; } }