package ῲ.ᨨ.ⁱ;

import android.annotation.SuppressLint;
import android.os.Build;
import android.text.PrecomputedText;
import android.text.Spannable;
import android.text.TextDirectionHeuristic;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.MetricAffectingSpan;
import ඓ.K.K.K.C1293;
import K.K.K.ʬ.C2369;

/* renamed from: ῲ.ᨨ.ⁱ.ῲ  reason: contains not printable characters */
/* compiled from: PrecomputedTextCompat */
public class C1810 implements Spannable {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final C1811 f6171;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final Spannable f6172;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final PrecomputedText f6173;

    /* renamed from: ῲ.ᨨ.ⁱ.ῲ$K  reason: contains not printable characters */
    /* compiled from: PrecomputedTextCompat */
    public static final class C1811 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final int f6174;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final TextDirectionHeuristic f6175;

        /* renamed from: K  reason: contains not printable characters */
        public final TextPaint f6176;

        /* renamed from: 㸾  reason: contains not printable characters */
        public final int f6177;

        @SuppressLint({"NewApi"})
        public C1811(TextPaint textPaint, TextDirectionHeuristic textDirectionHeuristic, int i, int i2) {
            if (Build.VERSION.SDK_INT >= 29) {
                new PrecomputedText.Params.Builder(textPaint).setBreakStrategy(i).setHyphenationFrequency(i2).setTextDirection(textDirectionHeuristic).build();
            }
            this.f6176 = textPaint;
            this.f6175 = textDirectionHeuristic;
            this.f6174 = i;
            this.f6177 = i2;
        }

        public boolean equals(Object obj) {
            if (obj == this) {
                return true;
            }
            if (!(obj instanceof C1811)) {
                return false;
            }
            C1811 k = (C1811) obj;
            if (!m4696(k)) {
                return false;
            }
            int i = Build.VERSION.SDK_INT;
            return this.f6175 == k.f6175;
        }

        public int hashCode() {
            if (Build.VERSION.SDK_INT >= 24) {
                return C2369.m6300(Float.valueOf(this.f6176.getTextSize()), Float.valueOf(this.f6176.getTextScaleX()), Float.valueOf(this.f6176.getTextSkewX()), Float.valueOf(this.f6176.getLetterSpacing()), Integer.valueOf(this.f6176.getFlags()), this.f6176.getTextLocales(), this.f6176.getTypeface(), Boolean.valueOf(this.f6176.isElegantTextHeight()), this.f6175, Integer.valueOf(this.f6174), Integer.valueOf(this.f6177));
            }
            return C2369.m6300(Float.valueOf(this.f6176.getTextSize()), Float.valueOf(this.f6176.getTextScaleX()), Float.valueOf(this.f6176.getTextSkewX()), Float.valueOf(this.f6176.getLetterSpacing()), Integer.valueOf(this.f6176.getFlags()), this.f6176.getTextLocale(), this.f6176.getTypeface(), Boolean.valueOf(this.f6176.isElegantTextHeight()), this.f6175, Integer.valueOf(this.f6174), Integer.valueOf(this.f6177));
        }

        public String toString() {
            StringBuilder sb = new StringBuilder("{");
            StringBuilder r1 = C1293.m3416("textSize=");
            r1.append(this.f6176.getTextSize());
            sb.append(r1.toString());
            sb.append(", textScaleX=" + this.f6176.getTextScaleX());
            sb.append(", textSkewX=" + this.f6176.getTextSkewX());
            int i = Build.VERSION.SDK_INT;
            StringBuilder r12 = C1293.m3416(", letterSpacing=");
            r12.append(this.f6176.getLetterSpacing());
            sb.append(r12.toString());
            sb.append(", elegantTextHeight=" + this.f6176.isElegantTextHeight());
            if (Build.VERSION.SDK_INT >= 24) {
                StringBuilder r13 = C1293.m3416(", textLocale=");
                r13.append(this.f6176.getTextLocales());
                sb.append(r13.toString());
            } else {
                StringBuilder r14 = C1293.m3416(", textLocale=");
                r14.append(this.f6176.getTextLocale());
                sb.append(r14.toString());
            }
            StringBuilder r15 = C1293.m3416(", typeface=");
            r15.append(this.f6176.getTypeface());
            sb.append(r15.toString());
            if (Build.VERSION.SDK_INT >= 26) {
                StringBuilder r16 = C1293.m3416(", variationSettings=");
                r16.append(this.f6176.getFontVariationSettings());
                sb.append(r16.toString());
            }
            StringBuilder r17 = C1293.m3416(", textDir=");
            r17.append(this.f6175);
            sb.append(r17.toString());
            sb.append(", breakStrategy=" + this.f6174);
            sb.append(", hyphenationFrequency=" + this.f6177);
            sb.append("}");
            return sb.toString();
        }

        /* renamed from: ʬ  reason: contains not printable characters */
        public TextDirectionHeuristic m4693() {
            return this.f6175;
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public int m4694() {
            return this.f6177;
        }

        /* renamed from: K  reason: contains not printable characters */
        public int m4695() {
            return this.f6174;
        }

        /* renamed from: K  reason: contains not printable characters */
        public boolean m4696(C1811 k) {
            if ((Build.VERSION.SDK_INT >= 23 && (this.f6174 != k.f6174 || this.f6177 != k.f6177)) || this.f6176.getTextSize() != k.f6176.getTextSize() || this.f6176.getTextScaleX() != k.f6176.getTextScaleX() || this.f6176.getTextSkewX() != k.f6176.getTextSkewX()) {
                return false;
            }
            int i = Build.VERSION.SDK_INT;
            if (this.f6176.getLetterSpacing() != k.f6176.getLetterSpacing() || !TextUtils.equals(this.f6176.getFontFeatureSettings(), k.f6176.getFontFeatureSettings()) || this.f6176.getFlags() != k.f6176.getFlags()) {
                return false;
            }
            if (Build.VERSION.SDK_INT >= 24) {
                if (!this.f6176.getTextLocales().equals(k.f6176.getTextLocales())) {
                    return false;
                }
            } else if (!this.f6176.getTextLocale().equals(k.f6176.getTextLocale())) {
                return false;
            }
            if (this.f6176.getTypeface() == null) {
                if (k.f6176.getTypeface() != null) {
                    return false;
                }
                return true;
            } else if (!this.f6176.getTypeface().equals(k.f6176.getTypeface())) {
                return false;
            } else {
                return true;
            }
        }

        public C1811(PrecomputedText.Params params) {
            this.f6176 = params.getTextPaint();
            this.f6175 = params.getTextDirection();
            this.f6174 = params.getBreakStrategy();
            this.f6177 = params.getHyphenationFrequency();
            int i = Build.VERSION.SDK_INT;
        }
    }

    public char charAt(int i) {
        return this.f6172.charAt(i);
    }

    public int getSpanEnd(Object obj) {
        return this.f6172.getSpanEnd(obj);
    }

    public int getSpanFlags(Object obj) {
        return this.f6172.getSpanFlags(obj);
    }

    public int getSpanStart(Object obj) {
        return this.f6172.getSpanStart(obj);
    }

    @Override // android.text.Spanned
    @SuppressLint({"NewApi"})
    public <T> T[] getSpans(int i, int i2, Class<T> cls) {
        return Build.VERSION.SDK_INT >= 29 ? (T[]) this.f6173.getSpans(i, i2, cls) : (T[]) this.f6172.getSpans(i, i2, cls);
    }

    public int length() {
        return this.f6172.length();
    }

    public int nextSpanTransition(int i, int i2, Class cls) {
        return this.f6172.nextSpanTransition(i, i2, cls);
    }

    @SuppressLint({"NewApi"})
    public void removeSpan(Object obj) {
        if (obj instanceof MetricAffectingSpan) {
            throw new IllegalArgumentException("MetricAffectingSpan can not be removed from PrecomputedText.");
        } else if (Build.VERSION.SDK_INT >= 29) {
            this.f6173.removeSpan(obj);
        } else {
            this.f6172.removeSpan(obj);
        }
    }

    @SuppressLint({"NewApi"})
    public void setSpan(Object obj, int i, int i2, int i3) {
        if (obj instanceof MetricAffectingSpan) {
            throw new IllegalArgumentException("MetricAffectingSpan can not be set to PrecomputedText.");
        } else if (Build.VERSION.SDK_INT >= 29) {
            this.f6173.setSpan(obj, i, i2, i3);
        } else {
            this.f6172.setSpan(obj, i, i2, i3);
        }
    }

    public CharSequence subSequence(int i, int i2) {
        return this.f6172.subSequence(i, i2);
    }

    public String toString() {
        return this.f6172.toString();
    }
}
