what-the-bank/sources/androidx/appcompat/widget/AppCompatEditText.java

280 lines
8.2 KiB
Java

package androidx.appcompat.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.Editable;
import android.text.method.KeyListener;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.DragEvent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.textclassifier.TextClassifier;
import android.widget.EditText;
import androidx.core.view.ViewCompat;
import o.C0208BiK;
import o.C1205YMa;
import o.C14224fpF;
import o.CPS;
import o.FNY;
import o.Opp;
import o.SYO;
import o.URz;
import o.WpN;
import o.Yoi;
import o.ZMp;
import o.ZzE;
import o.irq;
import o.nKv;
import o.xsq;
/* loaded from: classes.dex */
public class AppCompatEditText extends EditText implements xsq {
private final C14224fpF a;
private final ZMp b;
private final C1205YMa c;
private LWm d;
private final WpN e;
private final Yoi g;
@Override // android.widget.EditText, android.widget.TextView
public /* bridge */ /* synthetic */ CharSequence getText() {
return getText();
}
public AppCompatEditText(Context context) {
this(context, null);
}
public AppCompatEditText(Context context, AttributeSet attributeSet) {
this(context, attributeSet, SYO.IeS.editTextStyle);
}
public AppCompatEditText(Context context, AttributeSet attributeSet, int i) {
super(ZzE.b(context), attributeSet, i);
nKv.b(getContext());
WpN wpN = new WpN(this);
this.e = wpN;
wpN.fy_(attributeSet, i);
Yoi yoi = new Yoi(this);
this.g = yoi;
yoi.he_(attributeSet, i);
yoi.a();
this.b = new ZMp(this);
this.c = new C1205YMa();
C14224fpF c14224fpF = new C14224fpF(this);
this.a = c14224fpF;
c14224fpF.gj_(attributeSet, i);
e(c14224fpF);
}
void e(C14224fpF c14224fpF) {
KeyListener keyListener = getKeyListener();
if (c14224fpF.gi_(keyListener)) {
boolean isFocusable = super.isFocusable();
boolean isClickable = super.isClickable();
boolean isLongClickable = super.isLongClickable();
int inputType = super.getInputType();
KeyListener gh_ = c14224fpF.gh_(keyListener);
if (gh_ == keyListener) {
return;
}
super.setKeyListener(gh_);
super.setRawInputType(inputType);
super.setFocusable(isFocusable);
super.setClickable(isClickable);
super.setLongClickable(isLongClickable);
}
}
@Override // android.widget.EditText, android.widget.TextView
public Editable getText() {
if (Build.VERSION.SDK_INT >= 28) {
return super.getText();
}
return super.getEditableText();
}
@Override // android.view.View
public void setBackgroundResource(int i) {
super.setBackgroundResource(i);
WpN wpN = this.e;
if (wpN != null) {
wpN.c(i);
}
}
@Override // android.view.View
public void setBackgroundDrawable(Drawable drawable) {
super.setBackgroundDrawable(drawable);
WpN wpN = this.e;
if (wpN != null) {
wpN.fz_(drawable);
}
}
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
WpN wpN = this.e;
if (wpN != null) {
wpN.fB_(colorStateList);
}
}
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
WpN wpN = this.e;
if (wpN != null) {
wpN.fC_(mode);
}
}
@Override // android.widget.TextView, android.view.View
protected void drawableStateChanged() {
super.drawableStateChanged();
WpN wpN = this.e;
if (wpN != null) {
wpN.a();
}
Yoi yoi = this.g;
if (yoi != null) {
yoi.a();
}
}
@Override // android.widget.TextView
public void setTextAppearance(Context context, int i) {
super.setTextAppearance(context, i);
Yoi yoi = this.g;
if (yoi != null) {
yoi.d(context, i);
}
}
@Override // android.widget.TextView, android.view.View
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
String[] s;
InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
this.g.hg_(this, onCreateInputConnection, editorInfo);
InputConnection go_ = Opp.go_(onCreateInputConnection, editorInfo, this);
if (go_ != null && Build.VERSION.SDK_INT <= 30 && (s = ViewCompat.s(this)) != null) {
C0208BiK.uy_(editorInfo, s);
go_ = CPS.uE_(this, go_, editorInfo);
}
return this.a.gk_(go_, editorInfo);
}
@Override // android.widget.TextView
public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
super.setCustomSelectionActionModeCallback(URz.wh_(this, callback));
}
@Override // android.widget.TextView
public ActionMode.Callback getCustomSelectionActionModeCallback() {
return URz.wg_(super.getCustomSelectionActionModeCallback());
}
private LWm a() {
if (this.d == null) {
this.d = new LWm(this);
}
return this.d;
}
@Override // android.widget.TextView
public void setTextClassifier(TextClassifier textClassifier) {
ZMp zMp;
if (Build.VERSION.SDK_INT >= 28 || (zMp = this.b) == null) {
a().gg_(textClassifier);
} else {
zMp.gY_(textClassifier);
}
}
@Override // android.widget.TextView
public TextClassifier getTextClassifier() {
ZMp zMp;
if (Build.VERSION.SDK_INT >= 28 || (zMp = this.b) == null) {
return a().gf_();
}
return zMp.gX_();
}
@Override // android.widget.TextView, android.view.View
public boolean onDragEvent(DragEvent dragEvent) {
if (FNY.gE_(this, dragEvent)) {
return true;
}
return super.onDragEvent(dragEvent);
}
@Override // android.widget.EditText, android.widget.TextView
public boolean onTextContextMenuItem(int i) {
if (FNY.gF_(this, i)) {
return true;
}
return super.onTextContextMenuItem(i);
}
@Override // o.xsq
public irq a(irq irqVar) {
return this.c.e(this, irqVar);
}
@Override // android.widget.TextView
public void setKeyListener(KeyListener keyListener) {
super.setKeyListener(this.a.gh_(keyListener));
}
public void setEmojiCompatEnabled(boolean z) {
this.a.d(z);
}
@Override // android.widget.TextView
public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
Yoi yoi = this.g;
if (yoi != null) {
yoi.l();
}
}
@Override // android.widget.TextView
public void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
Yoi yoi = this.g;
if (yoi != null) {
yoi.l();
}
}
public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
this.g.hh_(colorStateList);
this.g.a();
}
public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
this.g.hi_(mode);
this.g.a();
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public class LWm {
final AppCompatEditText b;
LWm(AppCompatEditText appCompatEditText) {
this.b = appCompatEditText;
}
public TextClassifier gf_() {
return AppCompatEditText.super.getTextClassifier();
}
public void gg_(TextClassifier textClassifier) {
AppCompatEditText.super.setTextClassifier(textClassifier);
}
}
}