package o0;

import android.os.Build;
import android.text.PrecomputedText;
import android.text.TextDirectionHeuristic;
import android.text.TextPaint;
import android.text.TextUtils;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes.dex */
public final class c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final TextPaint f31265a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f31266b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f31267c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final PrecomputedText.Params f31268d;

    @Nullable
    private final TextDirectionHeuristic mTextDir;

    public c(TextPaint textPaint, TextDirectionHeuristic textDirectionHeuristic, int i10, int i11) {
        if (Build.VERSION.SDK_INT >= 29) {
            this.f31268d = j4.a.l(textPaint).setBreakStrategy(i10).setHyphenationFrequency(i11).setTextDirection(textDirectionHeuristic).build();
        } else {
            this.f31268d = null;
        }
        this.f31265a = textPaint;
        this.mTextDir = textDirectionHeuristic;
        this.f31266b = i10;
        this.f31267c = i11;
    }

    public final boolean a(c cVar) {
        if (this.f31266b != cVar.f31266b || this.f31267c != cVar.f31267c) {
            return false;
        }
        TextPaint textPaint = this.f31265a;
        if (textPaint.getTextSize() != cVar.f31265a.getTextSize()) {
            return false;
        }
        float textScaleX = textPaint.getTextScaleX();
        TextPaint textPaint2 = cVar.f31265a;
        if (textScaleX == textPaint2.getTextScaleX() && textPaint.getTextSkewX() == textPaint2.getTextSkewX() && textPaint.getLetterSpacing() == textPaint2.getLetterSpacing() && TextUtils.equals(textPaint.getFontFeatureSettings(), textPaint2.getFontFeatureSettings()) && textPaint.getFlags() == textPaint2.getFlags() && textPaint.getTextLocales().equals(textPaint2.getTextLocales())) {
            return textPaint.getTypeface() == null ? textPaint2.getTypeface() == null : textPaint.getTypeface().equals(textPaint2.getTypeface());
        }
        return false;
    }

    public boolean equals(@Nullable Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof c)) {
            return false;
        }
        c cVar = (c) obj;
        return a(cVar) && this.mTextDir == cVar.getTextDirection();
    }

    @Nullable
    public TextDirectionHeuristic getTextDirection() {
        return this.mTextDir;
    }

    public final int hashCode() {
        TextPaint textPaint = this.f31265a;
        return p0.c.hash(Float.valueOf(textPaint.getTextSize()), Float.valueOf(textPaint.getTextScaleX()), Float.valueOf(textPaint.getTextSkewX()), Float.valueOf(textPaint.getLetterSpacing()), Integer.valueOf(textPaint.getFlags()), textPaint.getTextLocales(), textPaint.getTypeface(), Boolean.valueOf(textPaint.isElegantTextHeight()), this.mTextDir, Integer.valueOf(this.f31266b), Integer.valueOf(this.f31267c));
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("{");
        StringBuilder sb2 = new StringBuilder("textSize=");
        TextPaint textPaint = this.f31265a;
        sb2.append(textPaint.getTextSize());
        sb.append(sb2.toString());
        sb.append(", textScaleX=" + textPaint.getTextScaleX());
        sb.append(", textSkewX=" + textPaint.getTextSkewX());
        int i10 = Build.VERSION.SDK_INT;
        sb.append(", letterSpacing=" + textPaint.getLetterSpacing());
        sb.append(", elegantTextHeight=" + textPaint.isElegantTextHeight());
        sb.append(", textLocale=" + textPaint.getTextLocales());
        sb.append(", typeface=" + textPaint.getTypeface());
        if (i10 >= 26) {
            sb.append(", variationSettings=" + textPaint.getFontVariationSettings());
        }
        sb.append(", textDir=" + this.mTextDir);
        sb.append(", breakStrategy=" + this.f31266b);
        sb.append(", hyphenationFrequency=" + this.f31267c);
        sb.append("}");
        return sb.toString();
    }

    public c(PrecomputedText.Params params) {
        this.f31265a = params.getTextPaint();
        this.mTextDir = params.getTextDirection();
        this.f31266b = params.getBreakStrategy();
        this.f31267c = params.getHyphenationFrequency();
        this.f31268d = Build.VERSION.SDK_INT < 29 ? null : params;
    }
}
