what-the-bank/sources/com/scb/phone/view/custom/ScbEditText.java

55 lines
1.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.custom;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.util.AttributeSet;
import com.google.android.material.textfield.TextInputEditText;
import com.scb.phone.R;
import o.nMh;
/* loaded from: classes5.dex */
public class ScbEditText extends TextInputEditText {
private Sts e;
/* loaded from: classes5.dex */
public interface Sts {
boolean c(ScbEditText scbEditText, String str);
}
public ScbEditText(Context context) {
super(context);
}
public ScbEditText(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public ScbEditText(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
public void setInvalidInput(boolean z) {
if (z) {
setBackgroundDrawable(nMh.getDrawable(getContext(), R.drawable.shape_red_reounded_reactangle_border));
} else {
setBackgroundDrawable(nMh.getDrawable(getContext(), R.drawable.shape_gray_rounded_rectangle));
}
}
@Override // androidx.appcompat.widget.AppCompatEditText, android.widget.EditText, android.widget.TextView
public boolean onTextContextMenuItem(int i) {
if (i == 16908322) {
ClipData primaryClip = ((ClipboardManager) getContext().getSystemService("clipboard")).getPrimaryClip();
if (this.e != null && primaryClip != null) {
return this.e.c(this, primaryClip.getItemAt(0).coerceToText(getContext()).toString());
}
}
return super.onTextContextMenuItem(i);
}
public void setOnPasteListener(Sts sts) {
this.e = sts;
}
}