package X6FRs_4.IMuAHx_6.Nm6q_10;

import android.os.Build;
import android.text.PrecomputedText;
import android.text.Spannable;
import android.text.TextDirectionHeuristic;
import android.text.TextDirectionHeuristics;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.MetricAffectingSpan;
/* compiled from: PrecomputedTextCompat.java */
/* loaded from: classes.dex */
public class PGPF6hQ_2 implements Spannable {
    public final KQgRr5e_0 KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final Spannable f480KQgRr5e_0;

    /* compiled from: PrecomputedTextCompat.java */
    /* loaded from: classes.dex */
    public static final class KQgRr5e_0 {
        public final int KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final PrecomputedText.Params f481KQgRr5e_0 = null;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final TextDirectionHeuristic f482KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final TextPaint f483KQgRr5e_0;
        public final int QxJ9d_1;

        /* compiled from: PrecomputedTextCompat.java */
        /* renamed from: X6FRs_4.IMuAHx_6.Nm6q_10.PGPF6hQ_2$KQgRr5e_0$KQgRr5e_0  reason: collision with other inner class name */
        /* loaded from: classes.dex */
        public static class C0042KQgRr5e_0 {
            public int KQgRr5e_0;

            /* renamed from: KQgRr5e_0  reason: collision with other field name */
            public TextDirectionHeuristic f484KQgRr5e_0;

            /* renamed from: KQgRr5e_0  reason: collision with other field name */
            public final TextPaint f485KQgRr5e_0;
            public int QxJ9d_1;

            public C0042KQgRr5e_0(TextPaint textPaint) {
                this.f485KQgRr5e_0 = textPaint;
                if (Build.VERSION.SDK_INT >= 23) {
                    this.KQgRr5e_0 = 1;
                    this.QxJ9d_1 = 1;
                } else {
                    this.QxJ9d_1 = 0;
                    this.KQgRr5e_0 = 0;
                }
                if (Build.VERSION.SDK_INT >= 18) {
                    this.f484KQgRr5e_0 = TextDirectionHeuristics.FIRSTSTRONG_LTR;
                } else {
                    this.f484KQgRr5e_0 = null;
                }
            }

            public C0042KQgRr5e_0 KQgRr5e_0(int i) {
                this.KQgRr5e_0 = i;
                return this;
            }

            public C0042KQgRr5e_0 QxJ9d_1(int i) {
                this.QxJ9d_1 = i;
                return this;
            }

            public C0042KQgRr5e_0 KQgRr5e_0(TextDirectionHeuristic textDirectionHeuristic) {
                this.f484KQgRr5e_0 = textDirectionHeuristic;
                return this;
            }

            public KQgRr5e_0 KQgRr5e_0() {
                return new KQgRr5e_0(this.f485KQgRr5e_0, this.f484KQgRr5e_0, this.KQgRr5e_0, this.QxJ9d_1);
            }
        }

        public KQgRr5e_0(TextPaint textPaint, TextDirectionHeuristic textDirectionHeuristic, int i, int i2) {
            this.f483KQgRr5e_0 = textPaint;
            this.f482KQgRr5e_0 = textDirectionHeuristic;
            this.KQgRr5e_0 = i;
            this.QxJ9d_1 = i2;
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public TextPaint m317KQgRr5e_0() {
            return this.f483KQgRr5e_0;
        }

        public int QxJ9d_1() {
            return this.QxJ9d_1;
        }

        public boolean equals(Object obj) {
            if (obj == this) {
                return true;
            }
            if (obj instanceof KQgRr5e_0) {
                KQgRr5e_0 kQgRr5e_0 = (KQgRr5e_0) obj;
                if (KQgRr5e_0(kQgRr5e_0)) {
                    return Build.VERSION.SDK_INT < 18 || this.f482KQgRr5e_0 == kQgRr5e_0.m316KQgRr5e_0();
                }
                return false;
            }
            return false;
        }

        public int hashCode() {
            int i = Build.VERSION.SDK_INT;
            if (i >= 24) {
                return X6FRs_4.IMuAHx_6.KNBe_11.PGPF6hQ_2.KQgRr5e_0(Float.valueOf(this.f483KQgRr5e_0.getTextSize()), Float.valueOf(this.f483KQgRr5e_0.getTextScaleX()), Float.valueOf(this.f483KQgRr5e_0.getTextSkewX()), Float.valueOf(this.f483KQgRr5e_0.getLetterSpacing()), Integer.valueOf(this.f483KQgRr5e_0.getFlags()), this.f483KQgRr5e_0.getTextLocales(), this.f483KQgRr5e_0.getTypeface(), Boolean.valueOf(this.f483KQgRr5e_0.isElegantTextHeight()), this.f482KQgRr5e_0, Integer.valueOf(this.KQgRr5e_0), Integer.valueOf(this.QxJ9d_1));
            }
            if (i >= 21) {
                return X6FRs_4.IMuAHx_6.KNBe_11.PGPF6hQ_2.KQgRr5e_0(Float.valueOf(this.f483KQgRr5e_0.getTextSize()), Float.valueOf(this.f483KQgRr5e_0.getTextScaleX()), Float.valueOf(this.f483KQgRr5e_0.getTextSkewX()), Float.valueOf(this.f483KQgRr5e_0.getLetterSpacing()), Integer.valueOf(this.f483KQgRr5e_0.getFlags()), this.f483KQgRr5e_0.getTextLocale(), this.f483KQgRr5e_0.getTypeface(), Boolean.valueOf(this.f483KQgRr5e_0.isElegantTextHeight()), this.f482KQgRr5e_0, Integer.valueOf(this.KQgRr5e_0), Integer.valueOf(this.QxJ9d_1));
            }
            if (i >= 18) {
                return X6FRs_4.IMuAHx_6.KNBe_11.PGPF6hQ_2.KQgRr5e_0(Float.valueOf(this.f483KQgRr5e_0.getTextSize()), Float.valueOf(this.f483KQgRr5e_0.getTextScaleX()), Float.valueOf(this.f483KQgRr5e_0.getTextSkewX()), Integer.valueOf(this.f483KQgRr5e_0.getFlags()), this.f483KQgRr5e_0.getTextLocale(), this.f483KQgRr5e_0.getTypeface(), this.f482KQgRr5e_0, Integer.valueOf(this.KQgRr5e_0), Integer.valueOf(this.QxJ9d_1));
            }
            if (i >= 17) {
                return X6FRs_4.IMuAHx_6.KNBe_11.PGPF6hQ_2.KQgRr5e_0(Float.valueOf(this.f483KQgRr5e_0.getTextSize()), Float.valueOf(this.f483KQgRr5e_0.getTextScaleX()), Float.valueOf(this.f483KQgRr5e_0.getTextSkewX()), Integer.valueOf(this.f483KQgRr5e_0.getFlags()), this.f483KQgRr5e_0.getTextLocale(), this.f483KQgRr5e_0.getTypeface(), this.f482KQgRr5e_0, Integer.valueOf(this.KQgRr5e_0), Integer.valueOf(this.QxJ9d_1));
            }
            return X6FRs_4.IMuAHx_6.KNBe_11.PGPF6hQ_2.KQgRr5e_0(Float.valueOf(this.f483KQgRr5e_0.getTextSize()), Float.valueOf(this.f483KQgRr5e_0.getTextScaleX()), Float.valueOf(this.f483KQgRr5e_0.getTextSkewX()), Integer.valueOf(this.f483KQgRr5e_0.getFlags()), this.f483KQgRr5e_0.getTypeface(), this.f482KQgRr5e_0, Integer.valueOf(this.KQgRr5e_0), Integer.valueOf(this.QxJ9d_1));
        }

        public String toString() {
            StringBuilder sb = new StringBuilder("{");
            sb.append("textSize=" + this.f483KQgRr5e_0.getTextSize());
            sb.append(", textScaleX=" + this.f483KQgRr5e_0.getTextScaleX());
            sb.append(", textSkewX=" + this.f483KQgRr5e_0.getTextSkewX());
            if (Build.VERSION.SDK_INT >= 21) {
                sb.append(", letterSpacing=" + this.f483KQgRr5e_0.getLetterSpacing());
                sb.append(", elegantTextHeight=" + this.f483KQgRr5e_0.isElegantTextHeight());
            }
            int i = Build.VERSION.SDK_INT;
            if (i >= 24) {
                sb.append(", textLocale=" + this.f483KQgRr5e_0.getTextLocales());
            } else if (i >= 17) {
                sb.append(", textLocale=" + this.f483KQgRr5e_0.getTextLocale());
            }
            sb.append(", typeface=" + this.f483KQgRr5e_0.getTypeface());
            if (Build.VERSION.SDK_INT >= 26) {
                sb.append(", variationSettings=" + this.f483KQgRr5e_0.getFontVariationSettings());
            }
            sb.append(", textDir=" + this.f482KQgRr5e_0);
            sb.append(", breakStrategy=" + this.KQgRr5e_0);
            sb.append(", hyphenationFrequency=" + this.QxJ9d_1);
            sb.append("}");
            return sb.toString();
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public TextDirectionHeuristic m316KQgRr5e_0() {
            return this.f482KQgRr5e_0;
        }

        public int KQgRr5e_0() {
            return this.KQgRr5e_0;
        }

        public boolean KQgRr5e_0(KQgRr5e_0 kQgRr5e_0) {
            PrecomputedText.Params params = this.f481KQgRr5e_0;
            if (params != null) {
                return params.equals(kQgRr5e_0.f481KQgRr5e_0);
            }
            if ((Build.VERSION.SDK_INT < 23 || (this.KQgRr5e_0 == kQgRr5e_0.KQgRr5e_0() && this.QxJ9d_1 == kQgRr5e_0.QxJ9d_1())) && this.f483KQgRr5e_0.getTextSize() == kQgRr5e_0.m317KQgRr5e_0().getTextSize() && this.f483KQgRr5e_0.getTextScaleX() == kQgRr5e_0.m317KQgRr5e_0().getTextScaleX() && this.f483KQgRr5e_0.getTextSkewX() == kQgRr5e_0.m317KQgRr5e_0().getTextSkewX()) {
                if ((Build.VERSION.SDK_INT < 21 || (this.f483KQgRr5e_0.getLetterSpacing() == kQgRr5e_0.m317KQgRr5e_0().getLetterSpacing() && TextUtils.equals(this.f483KQgRr5e_0.getFontFeatureSettings(), kQgRr5e_0.m317KQgRr5e_0().getFontFeatureSettings()))) && this.f483KQgRr5e_0.getFlags() == kQgRr5e_0.m317KQgRr5e_0().getFlags()) {
                    int i = Build.VERSION.SDK_INT;
                    if (i >= 24) {
                        if (!this.f483KQgRr5e_0.getTextLocales().equals(kQgRr5e_0.m317KQgRr5e_0().getTextLocales())) {
                            return false;
                        }
                    } else if (i >= 17 && !this.f483KQgRr5e_0.getTextLocale().equals(kQgRr5e_0.m317KQgRr5e_0().getTextLocale())) {
                        return false;
                    }
                    return this.f483KQgRr5e_0.getTypeface() == null ? kQgRr5e_0.m317KQgRr5e_0().getTypeface() == null : this.f483KQgRr5e_0.getTypeface().equals(kQgRr5e_0.m317KQgRr5e_0().getTypeface());
                }
                return false;
            }
            return false;
        }

        public KQgRr5e_0(PrecomputedText.Params params) {
            this.f483KQgRr5e_0 = params.getTextPaint();
            this.f482KQgRr5e_0 = params.getTextDirection();
            this.KQgRr5e_0 = params.getBreakStrategy();
            this.QxJ9d_1 = params.getHyphenationFrequency();
        }
    }

    public KQgRr5e_0 KQgRr5e_0() {
        return this.KQgRr5e_0;
    }

    @Override // java.lang.CharSequence
    public char charAt(int i) {
        return this.f480KQgRr5e_0.charAt(i);
    }

    @Override // android.text.Spanned
    public int getSpanEnd(Object obj) {
        return this.f480KQgRr5e_0.getSpanEnd(obj);
    }

    @Override // android.text.Spanned
    public int getSpanFlags(Object obj) {
        return this.f480KQgRr5e_0.getSpanFlags(obj);
    }

    @Override // android.text.Spanned
    public int getSpanStart(Object obj) {
        return this.f480KQgRr5e_0.getSpanStart(obj);
    }

    @Override // android.text.Spanned
    public <T> T[] getSpans(int i, int i2, Class<T> cls) {
        return (T[]) this.f480KQgRr5e_0.getSpans(i, i2, cls);
    }

    @Override // java.lang.CharSequence
    public int length() {
        return this.f480KQgRr5e_0.length();
    }

    @Override // android.text.Spanned
    public int nextSpanTransition(int i, int i2, Class cls) {
        return this.f480KQgRr5e_0.nextSpanTransition(i, i2, cls);
    }

    @Override // android.text.Spannable
    public void removeSpan(Object obj) {
        if (!(obj instanceof MetricAffectingSpan)) {
            this.f480KQgRr5e_0.removeSpan(obj);
            return;
        }
        throw new IllegalArgumentException("MetricAffectingSpan can not be removed from PrecomputedText.");
    }

    @Override // android.text.Spannable
    public void setSpan(Object obj, int i, int i2, int i3) {
        if (!(obj instanceof MetricAffectingSpan)) {
            this.f480KQgRr5e_0.setSpan(obj, i, i2, i3);
            return;
        }
        throw new IllegalArgumentException("MetricAffectingSpan can not be set to PrecomputedText.");
    }

    @Override // java.lang.CharSequence
    public CharSequence subSequence(int i, int i2) {
        return this.f480KQgRr5e_0.subSequence(i, i2);
    }

    @Override // java.lang.CharSequence
    public String toString() {
        return this.f480KQgRr5e_0.toString();
    }
}
