package p037.p041.p051;

import android.R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.TextDirectionHeuristic;
import android.text.TextDirectionHeuristics;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.textclassifier.TextClassifier;
import android.widget.TextView;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import p037.p041.p042.LayoutInflaterFactory2C1494;
import p037.p041.p043.p044.C1527;
import p037.p065.p070.C1865;
import p037.p065.p076.C1898;
import p037.p065.p080.InterfaceC1963;
import p037.p065.p080.InterfaceC1967;

/* JADX INFO: renamed from: މ.ؠ.ގ.ޖ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C1642 extends TextView implements InterfaceC1967, InterfaceC1963 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final C1610 f5328;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final C1640 f5329;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final C1639 f5330;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public Future<C1898> f5331;

    public C1642(Context context) {
        this(context, null);
    }

    public C1642(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, R.attr.textViewStyle);
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C1642(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        C1686.m3292(context);
        C1684.m3289(this, getContext());
        C1610 c1610 = new C1610(this);
        this.f5328 = c1610;
        c1610.m3148(attributeSet, i);
        C1640 c1640 = new C1640(this);
        this.f5329 = c1640;
        c1640.m3202(attributeSet, i);
        this.f5329.m3194();
        this.f5330 = new C1639(this);
    }

    @Override // android.widget.TextView, android.view.View
    public void drawableStateChanged() {
        super.drawableStateChanged();
        C1610 c1610 = this.f5328;
        if (c1610 != null) {
            c1610.m3144();
        }
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3194();
        }
    }

    @Override // android.widget.TextView
    public int getAutoSizeMaxTextSize() {
        if (InterfaceC1963.f6450) {
            return super.getAutoSizeMaxTextSize();
        }
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            return Math.round(c1640.f5319.f5339);
        }
        return -1;
    }

    @Override // android.widget.TextView
    public int getAutoSizeMinTextSize() {
        if (InterfaceC1963.f6450) {
            return super.getAutoSizeMinTextSize();
        }
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            return Math.round(c1640.f5319.f5338);
        }
        return -1;
    }

    @Override // android.widget.TextView
    public int getAutoSizeStepGranularity() {
        if (InterfaceC1963.f6450) {
            return super.getAutoSizeStepGranularity();
        }
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            return Math.round(c1640.f5319.f5337);
        }
        return -1;
    }

    @Override // android.widget.TextView
    public int[] getAutoSizeTextAvailableSizes() {
        if (InterfaceC1963.f6450) {
            return super.getAutoSizeTextAvailableSizes();
        }
        C1640 c1640 = this.f5329;
        return c1640 != null ? c1640.f5319.f5340 : new int[0];
    }

    @Override // android.widget.TextView
    @SuppressLint({"WrongConstant"})
    public int getAutoSizeTextType() {
        if (InterfaceC1963.f6450) {
            return super.getAutoSizeTextType() == 1 ? 1 : 0;
        }
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            return c1640.f5319.f5335;
        }
        return 0;
    }

    @Override // android.widget.TextView
    public int getFirstBaselineToTopHeight() {
        return getPaddingTop() - getPaint().getFontMetricsInt().top;
    }

    @Override // android.widget.TextView
    public int getLastBaselineToBottomHeight() {
        return getPaddingBottom() + getPaint().getFontMetricsInt().bottom;
    }

    public ColorStateList getSupportBackgroundTintList() {
        C1610 c1610 = this.f5328;
        if (c1610 != null) {
            return c1610.m3149();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C1610 c1610 = this.f5328;
        if (c1610 != null) {
            return c1610.m3151();
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        C1687 c1687 = this.f5329.f5318;
        if (c1687 != null) {
            return c1687.f5491;
        }
        return null;
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        C1687 c1687 = this.f5329.f5318;
        if (c1687 != null) {
            return c1687.f5492;
        }
        return null;
    }

    @Override // android.widget.TextView
    public CharSequence getText() {
        Future<C1898> future = this.f5331;
        if (future != null) {
            try {
                this.f5331 = null;
                LayoutInflaterFactory2C1494.C1505.m2947((TextView) this, future.get());
            } catch (InterruptedException | ExecutionException unused) {
            }
        }
        return super.getText();
    }

    @Override // android.widget.TextView
    public TextClassifier getTextClassifier() {
        C1639 c1639;
        return (Build.VERSION.SDK_INT >= 28 || (c1639 = this.f5330) == null) ? super.getTextClassifier() : c1639.m3192();
    }

    public C1898.C1899 getTextMetricsParamsCompat() {
        return LayoutInflaterFactory2C1494.C1505.m2928((TextView) this);
    }

    @Override // android.widget.TextView, android.view.View
    public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
        InputConnection inputConnectionOnCreateInputConnection = super.onCreateInputConnection(editorInfo);
        LayoutInflaterFactory2C1494.C1505.m2898(inputConnectionOnCreateInputConnection, editorInfo, this);
        return inputConnectionOnCreateInputConnection;
    }

    @Override // android.widget.TextView, android.view.View
    public void onLayout(boolean z, int i, int i2, int i3, int i4) {
        super.onLayout(z, i, i2, i3, i4);
        C1640 c1640 = this.f5329;
        if (c1640 == null || InterfaceC1963.f6450) {
            return;
        }
        c1640.f5319.m3209();
    }

    @Override // android.widget.TextView, android.view.View
    public void onMeasure(int i, int i2) {
        Future<C1898> future = this.f5331;
        if (future != null) {
            try {
                this.f5331 = null;
                LayoutInflaterFactory2C1494.C1505.m2947((TextView) this, future.get());
            } catch (InterruptedException | ExecutionException unused) {
            }
        }
        super.onMeasure(i, i2);
    }

    @Override // android.widget.TextView
    public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        super.onTextChanged(charSequence, i, i2, i3);
        C1640 c1640 = this.f5329;
        if (c1640 == null || InterfaceC1963.f6450 || !c1640.m3204()) {
            return;
        }
        this.f5329.f5319.m3209();
    }

    @Override // android.widget.TextView
    public void setAutoSizeTextTypeUniformWithConfiguration(int i, int i2, int i3, int i4) {
        if (InterfaceC1963.f6450) {
            super.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
            return;
        }
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3196(i, i2, i3, i4);
        }
    }

    @Override // android.widget.TextView
    public void setAutoSizeTextTypeUniformWithPresetSizes(int[] iArr, int i) {
        if (InterfaceC1963.f6450) {
            super.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
            return;
        }
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3203(iArr, i);
        }
    }

    @Override // android.widget.TextView
    public void setAutoSizeTextTypeWithDefaults(int i) {
        if (InterfaceC1963.f6450) {
            super.setAutoSizeTextTypeWithDefaults(i);
            return;
        }
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3195(i);
        }
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C1610 c1610 = this.f5328;
        if (c1610 != null) {
            c1610.m3152();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C1610 c1610 = this.f5328;
        if (c1610 != null) {
            c1610.m3145(i);
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3194();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3194();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelativeWithIntrinsicBounds(int i, int i2, int i3, int i4) {
        Context context = getContext();
        setCompoundDrawablesRelativeWithIntrinsicBounds(i != 0 ? C1527.m3025(context, i) : null, i2 != 0 ? C1527.m3025(context, i2) : null, i3 != 0 ? C1527.m3025(context, i3) : null, i4 != 0 ? C1527.m3025(context, i4) : null);
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3194();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelativeWithIntrinsicBounds(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3194();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesWithIntrinsicBounds(int i, int i2, int i3, int i4) {
        Context context = getContext();
        setCompoundDrawablesWithIntrinsicBounds(i != 0 ? C1527.m3025(context, i) : null, i2 != 0 ? C1527.m3025(context, i2) : null, i3 != 0 ? C1527.m3025(context, i3) : null, i4 != 0 ? C1527.m3025(context, i4) : null);
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3194();
        }
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesWithIntrinsicBounds(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3194();
        }
    }

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

    @Override // android.widget.TextView
    public void setFirstBaselineToTopHeight(int i) {
        if (Build.VERSION.SDK_INT >= 28) {
            super.setFirstBaselineToTopHeight(i);
        } else {
            LayoutInflaterFactory2C1494.C1505.m2946(this, i);
        }
    }

    @Override // android.widget.TextView
    public void setLastBaselineToBottomHeight(int i) {
        if (Build.VERSION.SDK_INT >= 28) {
            super.setLastBaselineToBottomHeight(i);
        } else {
            LayoutInflaterFactory2C1494.C1505.m2980(this, i);
        }
    }

    @Override // android.widget.TextView
    public void setLineHeight(int i) {
        LayoutInflaterFactory2C1494.C1505.m2985(this, i);
    }

    public void setPrecomputedText(C1898 c1898) {
        LayoutInflaterFactory2C1494.C1505.m2947((TextView) this, c1898);
    }

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C1610 c1610 = this.f5328;
        if (c1610 != null) {
            c1610.m3150(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C1610 c1610 = this.f5328;
        if (c1610 != null) {
            c1610.m3147(mode);
        }
    }

    @Override // p037.p065.p080.InterfaceC1967
    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        this.f5329.m3199(colorStateList);
        this.f5329.m3194();
    }

    @Override // p037.p065.p080.InterfaceC1967
    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        this.f5329.m3200(mode);
        this.f5329.m3194();
    }

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        C1640 c1640 = this.f5329;
        if (c1640 != null) {
            c1640.m3197(context, i);
        }
    }

    @Override // android.widget.TextView
    public void setTextClassifier(TextClassifier textClassifier) {
        C1639 c1639;
        if (Build.VERSION.SDK_INT >= 28 || (c1639 = this.f5330) == null) {
            super.setTextClassifier(textClassifier);
        } else {
            c1639.f5310 = textClassifier;
        }
    }

    public void setTextFuture(Future<C1898> future) {
        this.f5331 = future;
        if (future != null) {
            requestLayout();
        }
    }

    public void setTextMetricsParamsCompat(C1898.C1899 c1899) {
        TextDirectionHeuristic textDirectionHeuristic = c1899.f6339;
        int i = 1;
        if (textDirectionHeuristic != TextDirectionHeuristics.FIRSTSTRONG_RTL && textDirectionHeuristic != TextDirectionHeuristics.FIRSTSTRONG_LTR) {
            if (textDirectionHeuristic == TextDirectionHeuristics.ANYRTL_LTR) {
                i = 2;
            } else if (textDirectionHeuristic == TextDirectionHeuristics.LTR) {
                i = 3;
            } else if (textDirectionHeuristic == TextDirectionHeuristics.RTL) {
                i = 4;
            } else if (textDirectionHeuristic == TextDirectionHeuristics.LOCALE) {
                i = 5;
            } else if (textDirectionHeuristic == TextDirectionHeuristics.FIRSTSTRONG_LTR) {
                i = 6;
            } else if (textDirectionHeuristic == TextDirectionHeuristics.FIRSTSTRONG_RTL) {
                i = 7;
            }
        }
        setTextDirection(i);
        if (Build.VERSION.SDK_INT >= 23) {
            getPaint().set(c1899.f6338);
            setBreakStrategy(c1899.f6340);
            setHyphenationFrequency(c1899.f6341);
        } else {
            float textScaleX = c1899.f6338.getTextScaleX();
            getPaint().set(c1899.f6338);
            if (textScaleX == getTextScaleX()) {
                setTextScaleX((textScaleX / 2.0f) + 1.0f);
            }
            setTextScaleX(textScaleX);
        }
    }

    @Override // android.widget.TextView
    public void setTextSize(int i, float f) {
        boolean z = InterfaceC1963.f6450;
        if (z) {
            super.setTextSize(i, f);
            return;
        }
        C1640 c1640 = this.f5329;
        if (c1640 == null || z || c1640.m3204()) {
            return;
        }
        c1640.f5319.m3211(i, f);
    }

    @Override // android.widget.TextView
    public void setTypeface(Typeface typeface, int i) {
        Typeface typefaceM3672 = (typeface == null || i <= 0) ? null : C1865.m3672(getContext(), typeface, i);
        if (typefaceM3672 != null) {
            typeface = typefaceM3672;
        }
        super.setTypeface(typeface, i);
    }
}
