package p028j;

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 p007c.C0485a;
import p023h0.C0784c;
import p023h0.C0829h1;
import p023h0.InterfaceC0794c1;
import p023h0.InterfaceC0808e1;
import p029j0.C1253d;
import p029j0.C1256f;
import p032k0.C1304j0;
import p032k0.C1344y0;
import p032k0.InterfaceC1285b1;

/* renamed from: j.k */
/* loaded from: classes.dex */
public class C1123k extends EditText implements InterfaceC0808e1, InterfaceC0794c1, InterfaceC1285b1 {

    /* renamed from: d */
    public final C1080d f2729d;

    /* renamed from: e */
    public final C1082d1 f2730e;

    /* renamed from: f */
    public final C1076c1 f2731f;

    /* renamed from: g */
    public final C1344y0 f2732g;

    /* renamed from: h */
    public final C1136l f2733h;

    /* renamed from: i */
    public C1124a f2734i;

    /* renamed from: j.k$a */
    /* loaded from: classes.dex */
    public class C1124a {
        public C1124a() {
        }

        /* renamed from: a */
        public TextClassifier m2089a() {
            return C1123k.super.getTextClassifier();
        }

        /* renamed from: b */
        public void m2088b(TextClassifier textClassifier) {
            C1123k.super.setTextClassifier(textClassifier);
        }
    }

    public C1123k(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, C0485a.editTextStyle);
    }

    public C1123k(Context context, AttributeSet attributeSet, int i) {
        super(C1091d3.m2198b(context), attributeSet, i);
        C1073b3.m2264a(this, getContext());
        C1080d c1080d = new C1080d(this);
        this.f2729d = c1080d;
        c1080d.m2248e(attributeSet, i);
        C1082d1 c1082d1 = new C1082d1(this);
        this.f2730e = c1082d1;
        c1082d1.m2225m(attributeSet, i);
        c1082d1.m2236b();
        this.f2731f = new C1076c1(this);
        this.f2732g = new C1344y0();
        C1136l c1136l = new C1136l(this);
        this.f2733h = c1136l;
        c1136l.m2060c(attributeSet, i);
        m2090d(c1136l);
    }

    private C1124a getSuperCaller() {
        if (this.f2734i == null) {
            this.f2734i = new C1124a();
        }
        return this.f2734i;
    }

    @Override // p023h0.InterfaceC0794c1
    /* renamed from: a */
    public C0784c mo2093a(C0784c c0784c) {
        return this.f2732g.mo1589a(this, c0784c);
    }

    /* renamed from: d */
    public void m2090d(C1136l c1136l) {
        KeyListener keyListener = getKeyListener();
        if (c1136l.m2061b(keyListener)) {
            boolean isFocusable = super.isFocusable();
            boolean isClickable = super.isClickable();
            boolean isLongClickable = super.isLongClickable();
            int inputType = super.getInputType();
            KeyListener m2062a = c1136l.m2062a(keyListener);
            if (m2062a == keyListener) {
                return;
            }
            super.setKeyListener(m2062a);
            super.setRawInputType(inputType);
            super.setFocusable(isFocusable);
            super.setClickable(isClickable);
            super.setLongClickable(isLongClickable);
        }
    }

    @Override // android.widget.TextView, android.view.View
    public void drawableStateChanged() {
        super.drawableStateChanged();
        C1080d c1080d = this.f2729d;
        if (c1080d != null) {
            c1080d.m2251b();
        }
        C1082d1 c1082d1 = this.f2730e;
        if (c1082d1 != null) {
            c1082d1.m2236b();
        }
    }

    @Override // android.widget.TextView
    public ActionMode.Callback getCustomSelectionActionModeCallback() {
        return C1304j0.m1668m(super.getCustomSelectionActionModeCallback());
    }

    @Override // p023h0.InterfaceC0808e1
    public ColorStateList getSupportBackgroundTintList() {
        C1080d c1080d = this.f2729d;
        if (c1080d != null) {
            return c1080d.m2250c();
        }
        return null;
    }

    @Override // p023h0.InterfaceC0808e1
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C1080d c1080d = this.f2729d;
        if (c1080d != null) {
            return c1080d.m2249d();
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        return this.f2730e.m2228j();
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return this.f2730e.m2227k();
    }

    @Override // android.widget.EditText, android.widget.TextView
    public Editable getText() {
        return Build.VERSION.SDK_INT >= 28 ? super.getText() : super.getEditableText();
    }

    @Override // android.widget.TextView
    public TextClassifier getTextClassifier() {
        C1076c1 c1076c1;
        return (Build.VERSION.SDK_INT >= 28 || (c1076c1 = this.f2731f) == null) ? getSuperCaller().m2089a() : c1076c1.m2256a();
    }

    @Override // android.widget.TextView, android.view.View
    public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
        String[] m2814t;
        InputConnection onCreateInputConnection = super.onCreateInputConnection(editorInfo);
        this.f2730e.m2220r(this, onCreateInputConnection, editorInfo);
        InputConnection m2004a = C1158n.m2004a(onCreateInputConnection, editorInfo, this);
        if (m2004a != null && Build.VERSION.SDK_INT <= 30 && (m2814t = C0829h1.m2814t(this)) != null) {
            C1253d.m1777d(editorInfo, m2814t);
            m2004a = C1256f.m1769c(this, m2004a, editorInfo);
        }
        return this.f2733h.m2059d(m2004a, editorInfo);
    }

    @Override // android.widget.TextView, android.view.View
    public boolean onDragEvent(DragEvent dragEvent) {
        if (C1172p0.m1947a(this, dragEvent)) {
            return true;
        }
        return super.onDragEvent(dragEvent);
    }

    @Override // android.widget.TextView
    public boolean onTextContextMenuItem(int i) {
        if (C1172p0.m1946b(this, i)) {
            return true;
        }
        return super.onTextContextMenuItem(i);
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C1080d c1080d = this.f2729d;
        if (c1080d != null) {
            c1080d.m2247f(drawable);
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C1080d c1080d = this.f2729d;
        if (c1080d != null) {
            c1080d.m2246g(i);
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        C1082d1 c1082d1 = this.f2730e;
        if (c1082d1 != null) {
            c1082d1.m2222p();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        C1082d1 c1082d1 = this.f2730e;
        if (c1082d1 != null) {
            c1082d1.m2222p();
        }
    }

    @Override // android.widget.TextView
    public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
        super.setCustomSelectionActionModeCallback(C1304j0.m1667n(this, callback));
    }

    public void setEmojiCompatEnabled(boolean z) {
        this.f2733h.m2058e(z);
    }

    @Override // android.widget.TextView
    public void setKeyListener(KeyListener keyListener) {
        super.setKeyListener(this.f2733h.m2062a(keyListener));
    }

    @Override // p023h0.InterfaceC0808e1
    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C1080d c1080d = this.f2729d;
        if (c1080d != null) {
            c1080d.m2244i(colorStateList);
        }
    }

    @Override // p023h0.InterfaceC0808e1
    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C1080d c1080d = this.f2729d;
        if (c1080d != null) {
            c1080d.m2243j(mode);
        }
    }

    @Override // p032k0.InterfaceC1285b1
    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        this.f2730e.m2215w(colorStateList);
        this.f2730e.m2236b();
    }

    @Override // p032k0.InterfaceC1285b1
    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        this.f2730e.m2214x(mode);
        this.f2730e.m2236b();
    }

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        C1082d1 c1082d1 = this.f2730e;
        if (c1082d1 != null) {
            c1082d1.m2221q(context, i);
        }
    }

    @Override // android.widget.TextView
    public void setTextClassifier(TextClassifier textClassifier) {
        C1076c1 c1076c1;
        if (Build.VERSION.SDK_INT >= 28 || (c1076c1 = this.f2731f) == null) {
            getSuperCaller().m2088b(textClassifier);
        } else {
            c1076c1.m2255b(textClassifier);
        }
    }
}