package com.google.android.material.slider;

import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewOverlay;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.SeekBar;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.core.view.s1;
import com.bumptech.glide.f;
import com.bumptech.glide.h;
import com.google.android.gms.measurement.internal.u1;
import com.google.android.material.internal.g;
import com.google.android.material.internal.q0;
import com.google.android.material.internal.w0;
import com.google.android.material.shape.k;
import com.google.android.material.shape.q;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import kotlinx.coroutines.y;
import l.e;
import v9.b;
import v9.d;
import x8.c;
import x8.l;
import x8.m;
import y3.s;

/* JADX INFO: loaded from: classes2.dex */
public abstract class a extends View {

    /* JADX INFO: renamed from: q1, reason: collision with root package name */
    public static final int f23205q1 = l.Widget_MaterialComponents_Slider;

    /* JADX INFO: renamed from: r1, reason: collision with root package name */
    public static final int f23206r1 = c.motionDurationMedium4;

    /* JADX INFO: renamed from: s1, reason: collision with root package name */
    public static final int f23207s1 = c.motionDurationShort3;

    /* JADX INFO: renamed from: t1, reason: collision with root package name */
    public static final int f23208t1 = c.motionEasingEmphasizedInterpolator;

    /* JADX INFO: renamed from: u1, reason: collision with root package name */
    public static final int f23209u1 = c.motionEasingEmphasizedAccelerateInterpolator;
    public final int A0;
    public final int B0;
    public float C0;
    public float D0;
    public MotionEvent E0;
    public boolean F0;
    public float G0;
    public float H0;
    public ArrayList I0;
    public int J0;
    public int K0;
    public float L0;
    public float[] M0;
    public int N0;
    public int O0;
    public int P0;
    public final ArrayList Q;
    public int Q0;
    public boolean R;
    public boolean R0;
    public ValueAnimator S;
    public boolean S0;
    public ValueAnimator T;
    public ColorStateList T0;
    public final int U;
    public ColorStateList U0;
    public final int V;
    public ColorStateList V0;
    public final int W;
    public ColorStateList W0;
    public ColorStateList X0;
    public final Path Y0;
    public final RectF Z0;

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

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public final int f23211a0;
    public final RectF a1;

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

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

    /* JADX INFO: renamed from: b1, reason: collision with root package name */
    public final RectF f23214b1;

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

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

    /* JADX INFO: renamed from: c1, reason: collision with root package name */
    public final RectF f23217c1;

    @Nullable
    private Drawable customThumbDrawable;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final Paint f23218d;

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

    /* JADX INFO: renamed from: d1, reason: collision with root package name */
    public final Rect f23220d1;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Paint f23221e;

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

    /* JADX INFO: renamed from: e1, reason: collision with root package name */
    public final RectF f23223e1;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final Paint f23224f;

    /* JADX INFO: renamed from: f0, reason: collision with root package name */
    public int f23225f0;

    /* JADX INFO: renamed from: f1, reason: collision with root package name */
    public final Rect f23226f1;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final Paint f23227g;

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

    /* JADX INFO: renamed from: g1, reason: collision with root package name */
    public final Matrix f23229g1;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final v9.c f23230h;

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    public int f23231h0;

    /* JADX INFO: renamed from: h1, reason: collision with root package name */
    public final k f23232h1;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final AccessibilityManager f23233i;

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    public int f23234i0;

    /* JADX INFO: renamed from: i1, reason: collision with root package name */
    public List f23235i1;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public s f23236j;

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    public int f23237j0;

    /* JADX INFO: renamed from: j1, reason: collision with root package name */
    public float f23238j1;

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

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    public int f23240k0;

    /* JADX INFO: renamed from: k1, reason: collision with root package name */
    public int f23241k1;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final ArrayList f23242l;

    /* JADX INFO: renamed from: l0, reason: collision with root package name */
    public int f23243l0;

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

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final ArrayList f23245m;

    /* JADX INFO: renamed from: m0, reason: collision with root package name */
    public int f23246m0;

    /* JADX INFO: renamed from: m1, reason: collision with root package name */
    public final v9.a f23247m1;

    /* JADX INFO: renamed from: n0, reason: collision with root package name */
    public int f23248n0;

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

    /* JADX INFO: renamed from: o0, reason: collision with root package name */
    public int f23250o0;

    /* JADX INFO: renamed from: o1, reason: collision with root package name */
    public final y.a f23251o1;

    /* JADX INFO: renamed from: p0, reason: collision with root package name */
    public int f23252p0;

    /* JADX INFO: renamed from: p1, reason: collision with root package name */
    public boolean f23253p1;

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    public int f23254q0;

    /* JADX INFO: renamed from: r0, reason: collision with root package name */
    public int f23255r0;

    /* JADX INFO: renamed from: s0, reason: collision with root package name */
    public int f23256s0;

    /* JADX INFO: renamed from: t0, reason: collision with root package name */
    public int f23257t0;

    @Nullable
    private ColorStateList trackIconActiveColor;

    @Nullable
    private Drawable trackIconActiveEnd;

    @Nullable
    private Drawable trackIconActiveStart;

    @Nullable
    private ColorStateList trackIconInactiveColor;

    @Nullable
    private Drawable trackIconInactiveEnd;

    @Nullable
    private Drawable trackIconInactiveStart;

    /* JADX INFO: renamed from: u0, reason: collision with root package name */
    public boolean f23258u0;

    /* JADX INFO: renamed from: v0, reason: collision with root package name */
    public boolean f23259v0;

    /* JADX INFO: renamed from: w0, reason: collision with root package name */
    public boolean f23260w0;

    /* JADX INFO: renamed from: x0, reason: collision with root package name */
    public boolean f23261x0;

    /* JADX INFO: renamed from: y0, reason: collision with root package name */
    public boolean f23262y0;
    public int z0;

    public a(@NonNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, c.sliderStyle);
    }

    private void calculateBoundsAndDrawTrackIcon(@NonNull Canvas canvas, @NonNull RectF rectF, @Nullable Drawable drawable, boolean z10) {
        if (drawable != null) {
            RectF rectF2 = this.f23223e1;
            int i10 = this.z0;
            int i11 = this.A0;
            if (rectF.right - rectF.left >= (i11 * 2) + i10) {
                float f10 = z10 ^ (q() || r()) ? rectF.left + i11 : (rectF.right - i11) - i10;
                float f11 = i10;
                float fC = c() - (f11 / 2.0f);
                rectF2.set(f10, fC, f10 + f11, f11 + fC);
            } else {
                rectF2.setEmpty();
            }
            if (rectF2.isEmpty()) {
                return;
            }
            if (r()) {
                this.f23229g1.mapRect(rectF2);
            }
            Rect rect = this.f23226f1;
            rectF2.round(rect);
            drawable.setBounds(rect);
            drawable.draw(canvas);
        }
    }

    @Nullable
    private Float calculateIncrementForKey(int i10) {
        if (this.R0) {
            float f10 = this.L0;
            fRound = f10 != 0.0f ? f10 : 1.0f;
            if ((this.H0 - this.G0) / fRound > 20) {
                fRound *= Math.round(r0 / r2);
            }
        } else {
            float f11 = this.L0;
            if (f11 != 0.0f) {
                fRound = f11;
            }
        }
        if (i10 == 69) {
            return Float.valueOf(-fRound);
        }
        if (i10 == 70 || i10 == 81) {
            return Float.valueOf(fRound);
        }
        switch (i10) {
            case 19:
                if (r()) {
                    return Float.valueOf(fRound);
                }
                return null;
            case 20:
                if (r()) {
                    return Float.valueOf(-fRound);
                }
                return null;
            case 21:
                if (!q()) {
                    fRound = -fRound;
                }
                return Float.valueOf(fRound);
            case 22:
                if (q()) {
                    fRound = -fRound;
                }
                return Float.valueOf(fRound);
            default:
                return null;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    @Nullable
    public ViewOverlay getContentViewOverlay() {
        ViewGroup contentView = w0.getContentView(this);
        if (contentView == null) {
            return null;
        }
        return contentView.getOverlay();
    }

    @Nullable
    private Boolean onKeyDownNoActiveThumb(int i10, @NonNull KeyEvent keyEvent) {
        if (i10 == 61) {
            return keyEvent.hasNoModifiers() ? Boolean.valueOf(s(1)) : keyEvent.isShiftPressed() ? Boolean.valueOf(s(-1)) : Boolean.FALSE;
        }
        if (i10 != 66) {
            if (i10 != 81) {
                if (i10 == 69) {
                    s(-1);
                    return Boolean.TRUE;
                }
                if (i10 != 70) {
                    switch (i10) {
                        case 21:
                            t(-1);
                            break;
                        case 22:
                            t(1);
                            break;
                    }
                    return Boolean.TRUE;
                }
            }
            s(1);
            return Boolean.TRUE;
        }
        this.J0 = this.K0;
        postInvalidate();
        return Boolean.TRUE;
    }

    public final void A() {
        double dRound;
        float f10 = this.f23238j1;
        float f11 = this.L0;
        if (f11 > 0.0f) {
            int i10 = (int) ((this.H0 - this.G0) / f11);
            dRound = ((double) Math.round(f10 * i10)) / ((double) i10);
        } else {
            dRound = f10;
        }
        if (q() || r()) {
            dRound = 1.0d - dRound;
        }
        float f12 = this.H0;
        float f13 = this.G0;
        z((float) ((dRound * ((double) (f12 - f13))) + ((double) f13)), this.J0);
    }

    public final void B(int i10, Rect rect) {
        int iU = this.f23240k0 + ((int) (u(getValues().get(i10).floatValue()) * this.Q0));
        int iC = c();
        int iMax = Math.max(this.f23243l0 / 2, this.f23222e0 / 2);
        int iMax2 = Math.max(this.f23246m0 / 2, this.f23222e0 / 2);
        RectF rectF = new RectF(iU - iMax, iC - iMax2, iU + iMax, iC + iMax2);
        if (r()) {
            this.f23229g1.mapRect(rectF);
        }
        rect.set((int) rectF.left, (int) rectF.top, (int) rectF.right, (int) rectF.bottom);
    }

    public final void C() {
        if ((!(getBackground() instanceof RippleDrawable)) || getMeasuredWidth() <= 0) {
            return;
        }
        Drawable background = getBackground();
        if (background instanceof RippleDrawable) {
            float fU = (u(((Float) this.I0.get(this.K0)).floatValue()) * this.Q0) + this.f23240k0;
            int iC = c();
            float f10 = this.f23248n0;
            float[] fArr = {fU - f10, iC - r5, fU + f10, iC + r5};
            if (r()) {
                this.f23229g1.mapPoints(fArr);
            }
            background.setHotspotBounds((int) fArr[0], (int) fArr[1], (int) fArr[2], (int) fArr[3]);
        }
    }

    public final void D() {
        float f10;
        boolean zR = r();
        boolean zQ = q();
        float f11 = 0.5f;
        if (zR && zQ) {
            f10 = 0.5f;
            f11 = -0.2f;
        } else {
            f10 = 1.2f;
            if (zR) {
                f11 = 1.2f;
                f10 = 0.5f;
            }
        }
        for (y9.a aVar : this.f23242l) {
            aVar.f36898r0 = f11;
            aVar.f36899s0 = f10;
            aVar.invalidateSelf();
        }
        int i10 = this.f23234i0;
        if (i10 == 0 || i10 == 1) {
            if (this.J0 == -1 || !isEnabled()) {
                k();
                return;
            } else {
                j();
                return;
            }
        }
        if (i10 == 2) {
            k();
            return;
        }
        if (i10 != 3) {
            throw new IllegalArgumentException("Unexpected labelBehavior: " + this.f23234i0);
        }
        if (isEnabled()) {
            Rect rect = new Rect();
            w0.getContentView(this).getHitRect(rect);
            if (getLocalVisibleRect(rect) && this.f23253p1) {
                j();
                return;
            }
        }
        k();
    }

    public final void E() {
        int i10 = this.f23250o0;
        if (i10 > 0) {
            int i11 = this.f23243l0;
            this.f23252p0 = i11;
            this.f23254q0 = i10;
            int iRound = Math.round(i11 * 0.5f);
            int i12 = this.f23243l0 - iRound;
            setThumbWidth(iRound);
            setThumbTrackGapSize(this.f23250o0 - (i12 / 2));
        }
    }

    public final void F() {
        N();
        float f10 = this.L0;
        int iMin = 0;
        if (f10 <= 0.0f) {
            G(0);
            return;
        }
        int i10 = this.N0;
        if (i10 == 0) {
            iMin = Math.min((int) (((this.H0 - this.G0) / f10) + 1.0f), (this.Q0 / this.f23219d0) + 1);
        } else if (i10 == 1) {
            int i11 = (int) (((this.H0 - this.G0) / f10) + 1.0f);
            if (i11 <= (this.Q0 / this.f23219d0) + 1) {
                iMin = i11;
            }
        } else if (i10 != 2) {
            throw new IllegalStateException("Unexpected tickVisibilityMode: " + this.N0);
        }
        G(iMin);
    }

    public final void G(int i10) {
        if (i10 == 0) {
            this.M0 = null;
            return;
        }
        float[] fArr = this.M0;
        if (fArr == null || fArr.length != i10 * 2) {
            this.M0 = new float[i10 * 2];
        }
        float f10 = this.Q0 / (i10 - 1);
        float fC = c();
        for (int i11 = 0; i11 < i10 * 2; i11 += 2) {
            float[] fArr2 = this.M0;
            fArr2[i11] = ((i11 / 2.0f) * f10) + this.f23240k0;
            fArr2[i11 + 1] = fC;
        }
        if (r()) {
            this.f23229g1.mapPoints(this.M0);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0053  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x009d  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void H(Canvas canvas, Paint paint, RectF rectF, float f10, BaseSlider$FullCornerDirection baseSlider$FullCornerDirection) {
        float fMax;
        float fMax2;
        if (rectF.isEmpty()) {
            return;
        }
        if (this.I0.isEmpty() || this.f23250o0 <= 0) {
            fMax = f10;
        } else {
            float fP = P(((Float) this.I0.get((q() || r()) ? this.I0.size() - 1 : 0)).floatValue()) - this.f23240k0;
            if (fP < f10) {
                fMax = Math.max(fP, this.f23257t0);
            }
        }
        if (this.I0.isEmpty() || this.f23250o0 <= 0) {
            fMax2 = f10;
        } else {
            float fP2 = P(((Float) this.I0.get((q() || r()) ? 0 : this.I0.size() - 1)).floatValue()) - this.f23240k0;
            float f11 = this.Q0;
            if (fP2 > f11 - f10) {
                fMax2 = Math.max(f11 - fP2, this.f23257t0);
            }
        }
        int iOrdinal = baseSlider$FullCornerDirection.ordinal();
        if (iOrdinal == 1) {
            fMax2 = this.f23257t0;
        } else if (iOrdinal == 2) {
            fMax = this.f23257t0;
        } else if (iOrdinal == 3) {
            fMax = this.f23257t0;
            fMax2 = fMax;
        }
        paint.setStyle(Paint.Style.FILL);
        paint.setStrokeCap(Paint.Cap.BUTT);
        if (this.f23250o0 > 0) {
            paint.setAntiAlias(true);
        }
        RectF rectF2 = new RectF(rectF);
        boolean zR = r();
        Matrix matrix = this.f23229g1;
        if (zR) {
            matrix.mapRect(rectF2);
        }
        Path path = this.Y0;
        path.reset();
        if (rectF.width() >= fMax + fMax2) {
            path.addRoundRect(rectF2, r() ? new float[]{fMax, fMax, fMax, fMax, fMax2, fMax2, fMax2, fMax2} : new float[]{fMax, fMax, fMax2, fMax2, fMax2, fMax2, fMax, fMax}, Path.Direction.CW);
            canvas.drawPath(path, paint);
            return;
        }
        float fMin = Math.min(fMax, fMax2);
        float fMax3 = Math.max(fMax, fMax2);
        canvas.save();
        path.addRoundRect(rectF2, fMin, fMin, Path.Direction.CW);
        canvas.clipPath(path);
        int iOrdinal2 = baseSlider$FullCornerDirection.ordinal();
        RectF rectF3 = this.f23217c1;
        if (iOrdinal2 == 1) {
            float f12 = rectF.left;
            rectF3.set(f12, rectF.top, (2.0f * fMax3) + f12, rectF.bottom);
        } else if (iOrdinal2 != 2) {
            rectF3.set(rectF.centerX() - fMax3, rectF.top, rectF.centerX() + fMax3, rectF.bottom);
        } else {
            float f13 = rectF.right;
            rectF3.set(f13 - (2.0f * fMax3), rectF.top, f13, rectF.bottom);
        }
        if (r()) {
            matrix.mapRect(rectF3);
        }
        canvas.drawRoundRect(rectF3, fMax3, fMax3, paint);
        canvas.restore();
    }

    public final void I() {
        Drawable drawable = this.trackIconActiveEnd;
        if (drawable != null) {
            if (!this.f23260w0 && this.trackIconActiveColor != null) {
                this.trackIconActiveEnd = drawable.mutate();
                this.f23260w0 = true;
            }
            if (this.f23260w0) {
                this.trackIconActiveEnd.setTintList(this.trackIconActiveColor);
            }
        }
    }

    public final void J() {
        Drawable drawable = this.trackIconActiveStart;
        if (drawable != null) {
            if (!this.f23259v0 && this.trackIconActiveColor != null) {
                this.trackIconActiveStart = drawable.mutate();
                this.f23259v0 = true;
            }
            if (this.f23259v0) {
                this.trackIconActiveStart.setTintList(this.trackIconActiveColor);
            }
        }
    }

    public final void K() {
        Drawable drawable = this.trackIconInactiveEnd;
        if (drawable != null) {
            if (!this.f23262y0 && this.trackIconInactiveColor != null) {
                this.trackIconInactiveEnd = drawable.mutate();
                this.f23262y0 = true;
            }
            if (this.f23262y0) {
                this.trackIconInactiveEnd.setTintList(this.trackIconInactiveColor);
            }
        }
    }

    public final void L() {
        Drawable drawable = this.trackIconInactiveStart;
        if (drawable != null) {
            if (!this.f23261x0 && this.trackIconInactiveColor != null) {
                this.trackIconInactiveStart = drawable.mutate();
                this.f23261x0 = true;
            }
            if (this.f23261x0) {
                this.trackIconInactiveStart.setTintList(this.trackIconInactiveColor);
            }
        }
    }

    public final void M(boolean z10) {
        int paddingTop;
        int paddingBottom;
        boolean z11;
        if (r()) {
            paddingTop = getPaddingLeft();
            paddingBottom = getPaddingRight();
        } else {
            paddingTop = getPaddingTop();
            paddingBottom = getPaddingBottom();
        }
        int i10 = paddingBottom + paddingTop;
        int iMax = Math.max(this.f23228g0, Math.max(this.f23237j0 + i10, this.f23246m0 + i10));
        boolean z12 = false;
        if (iMax == this.f23231h0) {
            z11 = false;
        } else {
            this.f23231h0 = iMax;
            z11 = true;
        }
        int iMax2 = Math.max(Math.max(Math.max((this.f23243l0 / 2) - this.W, 0), Math.max((this.f23237j0 - this.f23211a0) / 2, 0)), Math.max(Math.max(this.O0 - this.f23213b0, 0), Math.max(this.P0 - this.f23216c0, 0))) + this.V;
        if (this.f23240k0 != iMax2) {
            this.f23240k0 = iMax2;
            if (isLaidOut()) {
                this.Q0 = Math.max((r() ? getHeight() : getWidth()) - (this.f23240k0 * 2), 0);
                F();
            }
            z12 = true;
        }
        if (r()) {
            float fC = c();
            Matrix matrix = this.f23229g1;
            matrix.reset();
            matrix.setRotate(90.0f, fC, fC);
        }
        if (z11 || z10) {
            requestLayout();
        } else if (z12) {
            postInvalidate();
        }
    }

    public final void N() {
        if (this.S0) {
            if (this.G0 >= this.H0) {
                throw new IllegalStateException(String.format("valueFrom(%s) must be smaller than valueTo(%s)", Float.valueOf(this.G0), Float.valueOf(this.H0)));
            }
            for (Float f10 : this.I0) {
                if (f10.floatValue() < this.G0 || f10.floatValue() > this.H0) {
                    throw new IllegalStateException(String.format("Slider value(%s) must be greater or equal to valueFrom(%s), and lower or equal to valueTo(%s)", f10, Float.valueOf(this.G0), Float.valueOf(this.H0)));
                }
                if (this.L0 > 0.0f && !O(f10.floatValue())) {
                    throw new IllegalStateException(String.format("Value(%s) must be equal to valueFrom(%s) plus a multiple of stepSize(%s) when using stepSize(%s)", f10, Float.valueOf(this.G0), Float.valueOf(this.L0), Float.valueOf(this.L0)));
                }
            }
            if (this.L0 > 0.0f && !O(this.H0)) {
                throw new IllegalStateException(String.format("The stepSize(%s) must be 0, or a factor of the valueFrom(%s)-valueTo(%s) range", Float.valueOf(this.L0), Float.valueOf(this.G0), Float.valueOf(this.H0)));
            }
            float minSeparation = getMinSeparation();
            if (minSeparation < 0.0f) {
                throw new IllegalStateException(String.format("minSeparation(%s) must be greater or equal to 0", Float.valueOf(minSeparation)));
            }
            float f11 = this.L0;
            if (f11 > 0.0f && minSeparation > 0.0f) {
                if (this.f23241k1 != 1) {
                    throw new IllegalStateException(String.format("minSeparation(%s) cannot be set as a dimension when using stepSize(%s)", Float.valueOf(minSeparation), Float.valueOf(this.L0)));
                }
                if (minSeparation < f11 || !n(minSeparation)) {
                    throw new IllegalStateException(String.format("minSeparation(%s) must be greater or equal and a multiple of stepSize(%s) when using stepSize(%s)", Float.valueOf(minSeparation), Float.valueOf(this.L0), Float.valueOf(this.L0)));
                }
            }
            float f12 = this.L0;
            if (f12 != 0.0f) {
                if (((int) f12) != f12) {
                    String.format("Floating point value used for %s(%s). Using floats can have rounding errors which may result in incorrect values. Instead, consider using integers with a custom LabelFormatter to display the value correctly.", "stepSize", Float.valueOf(f12));
                }
                float f13 = this.G0;
                if (((int) f13) != f13) {
                    String.format("Floating point value used for %s(%s). Using floats can have rounding errors which may result in incorrect values. Instead, consider using integers with a custom LabelFormatter to display the value correctly.", "valueFrom", Float.valueOf(f13));
                }
                float f14 = this.H0;
                if (((int) f14) != f14) {
                    String.format("Floating point value used for %s(%s). Using floats can have rounding errors which may result in incorrect values. Instead, consider using integers with a custom LabelFormatter to display the value correctly.", "valueTo", Float.valueOf(f14));
                }
            }
            this.S0 = false;
        }
    }

    public final boolean O(float f10) {
        return n(new BigDecimal(Float.toString(f10)).subtract(new BigDecimal(Float.toString(this.G0)), MathContext.DECIMAL64).doubleValue());
    }

    public final float P(float f10) {
        return (u(f10) * this.Q0) + this.f23240k0;
    }

    public final void b(Drawable drawable) {
        int intrinsicWidth = drawable.getIntrinsicWidth();
        int intrinsicHeight = drawable.getIntrinsicHeight();
        if (intrinsicWidth == -1 && intrinsicHeight == -1) {
            drawable.setBounds(0, 0, this.f23243l0, this.f23246m0);
        } else {
            float fMax = Math.max(this.f23243l0, this.f23246m0) / Math.max(intrinsicWidth, intrinsicHeight);
            drawable.setBounds(0, 0, (int) (intrinsicWidth * fMax), (int) (intrinsicHeight * fMax));
        }
    }

    public final int c() {
        int i10 = this.f23231h0 / 2;
        int i11 = this.f23234i0;
        return i10 + ((i11 == 1 || i11 == 3) ? ((y9.a) this.f23242l.get(0)).getIntrinsicHeight() : 0);
    }

    public final ValueAnimator d(boolean z10) {
        int iO;
        TimeInterpolator timeInterpolatorP;
        float fFloatValue = z10 ? 0.0f : 1.0f;
        ValueAnimator valueAnimator = z10 ? this.T : this.S;
        if (valueAnimator != null && valueAnimator.isRunning()) {
            fFloatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue();
            valueAnimator.cancel();
        }
        ValueAnimator valueAnimatorOfFloat = ValueAnimator.ofFloat(fFloatValue, z10 ? 1.0f : 0.0f);
        if (z10) {
            iO = f.o(getContext(), f23206r1, 83);
            timeInterpolatorP = f.p(getContext(), f23208t1, y8.a.f36868e);
        } else {
            iO = f.o(getContext(), f23207s1, 117);
            timeInterpolatorP = f.p(getContext(), f23209u1, y8.a.f36866c);
        }
        valueAnimatorOfFloat.setDuration(iO);
        valueAnimatorOfFloat.setInterpolator(timeInterpolatorP);
        valueAnimatorOfFloat.addUpdateListener(new d9.b(this, 8));
        return valueAnimatorOfFloat;
    }

    @Override // android.view.View
    public final boolean dispatchHoverEvent(MotionEvent motionEvent) {
        return this.f23230h.k(motionEvent) || super.dispatchHoverEvent(motionEvent);
    }

    @Override // android.view.View
    public final boolean dispatchKeyEvent(KeyEvent keyEvent) {
        return super.dispatchKeyEvent(keyEvent);
    }

    @Override // android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        this.f23210a.setColor(m(this.X0));
        this.f23212b.setColor(m(this.W0));
        this.f23221e.setColor(m(this.V0));
        this.f23224f.setColor(m(this.U0));
        this.f23227g.setColor(m(this.V0));
        for (y9.a aVar : this.f23242l) {
            if (aVar.isStateful()) {
                aVar.setState(getDrawableState());
            }
        }
        k kVar = this.f23232h1;
        if (kVar.isStateful()) {
            kVar.setState(getDrawableState());
        }
        Paint paint = this.f23218d;
        paint.setColor(m(this.T0));
        paint.setAlpha(63);
    }

    public final void e(float f10, float f11, float f12, float f13, Canvas canvas, RectF rectF, BaseSlider$FullCornerDirection baseSlider$FullCornerDirection) {
        if (f11 - f10 > getTrackCornerSize() - this.f23250o0) {
            rectF.set(f10, f12, f11, f13);
        } else {
            rectF.setEmpty();
        }
        H(canvas, this.f23210a, rectF, getTrackCornerSize(), baseSlider$FullCornerDirection);
    }

    public final void f(Canvas canvas, float f10, float f11) {
        Iterator it = this.I0.iterator();
        while (it.hasNext()) {
            float fP = P(((Float) it.next()).floatValue());
            float f12 = (this.f23243l0 / 2.0f) + this.f23250o0;
            if (f10 >= fP - f12 && f10 <= fP + f12) {
                return;
            }
        }
        boolean zR = r();
        Paint paint = this.f23227g;
        if (zR) {
            canvas.drawPoint(f11, f10, paint);
        } else {
            canvas.drawPoint(f10, f11, paint);
        }
    }

    public final void g(Canvas canvas, int i10, int i11, float f10, Drawable drawable) {
        canvas.save();
        if (r()) {
            canvas.concat(this.f23229g1);
        }
        canvas.translate((this.f23240k0 + ((int) (u(f10) * i10))) - (drawable.getBounds().width() / 2.0f), i11 - (drawable.getBounds().height() / 2.0f));
        drawable.draw(canvas);
        canvas.restore();
    }

    @Override // android.view.View
    public CharSequence getAccessibilityClassName() {
        return SeekBar.class.getName();
    }

    @VisibleForTesting
    public final int getAccessibilityFocusedVirtualViewId() {
        return this.f23230h.f36669k;
    }

    public float getMinSeparation() {
        return 0.0f;
    }

    public int getThumbRadius() {
        return this.f23243l0 / 2;
    }

    public int getTrackCornerSize() {
        int i10 = this.f23256s0;
        return i10 == -1 ? this.f23237j0 / 2 : i10;
    }

    @Nullable
    public ColorStateList getTrackIconActiveColor() {
        return this.trackIconActiveColor;
    }

    @Nullable
    public Drawable getTrackIconActiveEnd() {
        return this.trackIconActiveEnd;
    }

    @Nullable
    public Drawable getTrackIconActiveStart() {
        return this.trackIconActiveStart;
    }

    @Nullable
    public ColorStateList getTrackIconInactiveColor() {
        return this.trackIconInactiveColor;
    }

    @Nullable
    public Drawable getTrackIconInactiveEnd() {
        return this.trackIconInactiveEnd;
    }

    @Nullable
    public Drawable getTrackIconInactiveStart() {
        return this.trackIconInactiveStart;
    }

    public float getValueFrom() {
        return this.G0;
    }

    public float getValueTo() {
        return this.H0;
    }

    @NonNull
    public List<Float> getValues() {
        return new ArrayList(this.I0);
    }

    /* JADX WARN: Removed duplicated region for block: B:14:0x0043  */
    /* JADX WARN: Removed duplicated region for block: B:21:0x0064  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void h(int i10, int i11, Canvas canvas, Paint paint) {
        while (i10 < i11) {
            float f10 = r() ? this.M0[i10 + 1] : this.M0[i10];
            float f11 = (this.f23243l0 / 2.0f) + this.f23250o0;
            Iterator it = this.I0.iterator();
            if (it.hasNext()) {
                float fP = P(((Float) it.next()).floatValue());
                if (f10 < fP - f11 || f10 > fP + f11) {
                    if (this.f23258u0) {
                        float f12 = (this.f23243l0 / 2.0f) + this.f23250o0;
                        float f13 = ((this.f23240k0 * 2) + this.Q0) / 2.0f;
                        if (f10 < f13 - f12 || f10 > f13 + f12) {
                            float[] fArr = this.M0;
                            canvas.drawPoint(fArr[i10], fArr[i10 + 1], paint);
                        }
                    }
                }
            }
            i10 += 2;
        }
    }

    public final void i(Canvas canvas, RectF rectF, RectF rectF2) {
        if (this.trackIconActiveStart == null && this.trackIconActiveEnd == null && this.trackIconInactiveStart == null && this.trackIconInactiveEnd == null) {
            return;
        }
        this.I0.size();
        calculateBoundsAndDrawTrackIcon(canvas, rectF, this.trackIconActiveStart, true);
        calculateBoundsAndDrawTrackIcon(canvas, rectF2, this.trackIconInactiveStart, true);
        calculateBoundsAndDrawTrackIcon(canvas, rectF, this.trackIconActiveEnd, false);
        calculateBoundsAndDrawTrackIcon(canvas, rectF2, this.trackIconInactiveEnd, false);
    }

    public final void j() {
        if (!this.R) {
            this.R = true;
            ValueAnimator valueAnimatorD = d(true);
            this.S = valueAnimatorD;
            this.T = null;
            valueAnimatorD.start();
        }
        ArrayList arrayList = this.f23242l;
        Iterator it = arrayList.iterator();
        for (int i10 = 0; i10 < this.I0.size() && it.hasNext(); i10++) {
            if (i10 != this.K0) {
                x((y9.a) it.next(), ((Float) this.I0.get(i10)).floatValue());
            }
        }
        if (!it.hasNext()) {
            throw new IllegalStateException(String.format("Not enough labels(%d) to display all the values(%d)", Integer.valueOf(arrayList.size()), Integer.valueOf(this.I0.size())));
        }
        x((y9.a) it.next(), ((Float) this.I0.get(this.K0)).floatValue());
    }

    public final void k() {
        if (this.R) {
            this.R = false;
            ValueAnimator valueAnimatorD = d(false);
            this.T = valueAnimatorD;
            this.S = null;
            valueAnimatorD.addListener(new e(this, 11));
            this.T.start();
        }
    }

    public final float[] l() {
        float fFloatValue = ((Float) this.I0.get(0)).floatValue();
        float fFloatValue2 = ((Float) u1.e(this.I0, 1)).floatValue();
        if (this.I0.size() == 1) {
            fFloatValue = this.G0;
        }
        float fU = u(fFloatValue);
        float fU2 = u(fFloatValue2);
        if (this.f23258u0) {
            float fMin = Math.min(0.5f, fU2);
            fU2 = Math.max(0.5f, fU2);
            fU = fMin;
        }
        return (this.f23258u0 || !(q() || r())) ? new float[]{fU, fU2} : new float[]{fU2, fU};
    }

    public final int m(ColorStateList colorStateList) {
        return colorStateList.getColorForState(getDrawableState(), colorStateList.getDefaultColor());
    }

    public final boolean n(double d10) {
        double dDoubleValue = new BigDecimal(Double.toString(d10)).divide(new BigDecimal(Float.toString(this.L0)), MathContext.DECIMAL64).doubleValue();
        return Math.abs(((double) Math.round(dDoubleValue)) - dDoubleValue) < 1.0E-4d;
    }

    public final boolean o(MotionEvent motionEvent) {
        if (motionEvent.getToolType(0) == 3) {
            return false;
        }
        for (ViewParent parent = getParent(); parent instanceof ViewGroup; parent = parent.getParent()) {
            ViewGroup viewGroup = (ViewGroup) parent;
            if ((viewGroup.canScrollHorizontally(1) || viewGroup.canScrollHorizontally(-1)) && viewGroup.shouldDelayChildPressedState()) {
                return true;
            }
        }
        return false;
    }

    @Override // android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.f23253p1 = isShown();
        getViewTreeObserver().addOnScrollChangedListener(this.f23247m1);
        getViewTreeObserver().addOnGlobalLayoutListener(this.f23249n1);
        Iterator it = this.f23242l.iterator();
        while (it.hasNext()) {
            ((y9.a) it.next()).setRelativeToView(w0.getContentView(this));
        }
    }

    @Override // android.view.View
    public final void onDetachedFromWindow() {
        s sVar = this.f23236j;
        if (sVar != null) {
            removeCallbacks(sVar);
        }
        this.R = false;
        for (y9.a aVar : this.f23242l) {
            ViewGroup contentView = w0.getContentView(this);
            if (contentView != null) {
                contentView.getOverlay().remove(aVar);
                aVar.detachView(contentView);
            }
        }
        getViewTreeObserver().removeOnScrollChangedListener(this.f23247m1);
        getViewTreeObserver().removeOnGlobalLayoutListener(this.f23249n1);
        super.onDetachedFromWindow();
    }

    /* JADX WARN: Removed duplicated region for block: B:55:0x013a  */
    /* JADX WARN: Removed duplicated region for block: B:56:0x0142  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void onDraw(Canvas canvas) {
        int i10;
        float f10;
        float f11;
        float f12;
        float f13;
        int i11;
        if (this.S0) {
            N();
            F();
        }
        super.onDraw(canvas);
        int iC = c();
        int i12 = this.Q0;
        float[] fArrL = l();
        float f14 = iC;
        float f15 = this.f23237j0 / 2.0f;
        float f16 = f14 - f15;
        float f17 = f15 + f14;
        float trackCornerSize = this.f23240k0 - getTrackCornerSize();
        float f18 = i12;
        float f19 = ((fArrL[0] * f18) + this.f23240k0) - this.f23250o0;
        RectF rectF = this.a1;
        BaseSlider$FullCornerDirection baseSlider$FullCornerDirection = BaseSlider$FullCornerDirection.f23199a;
        e(trackCornerSize, f19, f16, f17, canvas, rectF, baseSlider$FullCornerDirection);
        int i13 = this.f23240k0;
        float f20 = this.f23250o0 + (fArrL[1] * f18) + i13;
        float trackCornerSize2 = getTrackCornerSize() + i13 + i12;
        RectF rectF2 = this.f23214b1;
        BaseSlider$FullCornerDirection baseSlider$FullCornerDirection2 = BaseSlider$FullCornerDirection.f23200b;
        e(f20, trackCornerSize2, f16, f17, canvas, rectF2, baseSlider$FullCornerDirection2);
        int i14 = this.Q0;
        float[] fArrL2 = l();
        float f21 = this.f23240k0;
        float f22 = i14;
        float fP = (fArrL2[1] * f22) + f21;
        float f23 = (fArrL2[0] * f22) + f21;
        RectF rectF3 = this.Z0;
        int i15 = 2;
        if (f23 >= fP) {
            rectF3.setEmpty();
        } else {
            BaseSlider$FullCornerDirection baseSlider$FullCornerDirection3 = BaseSlider$FullCornerDirection.f23201c;
            if (this.I0.size() != 1 || this.f23258u0) {
                baseSlider$FullCornerDirection = baseSlider$FullCornerDirection3;
            } else if (q() || r()) {
                baseSlider$FullCornerDirection = baseSlider$FullCornerDirection2;
            }
            int i16 = 0;
            while (i16 < this.I0.size()) {
                if (this.I0.size() > 1) {
                    fP = i16 > 0 ? P(((Float) this.I0.get(i16 - 1)).floatValue()) : f23;
                    float fP2 = P(((Float) this.I0.get(i16)).floatValue());
                    if (q() || r()) {
                        f23 = fP2;
                    } else {
                        f23 = fP;
                        fP = fP2;
                    }
                }
                int trackCornerSize3 = getTrackCornerSize();
                int iOrdinal = baseSlider$FullCornerDirection.ordinal();
                if (iOrdinal != 1) {
                    if (iOrdinal == i15) {
                        f23 += this.f23250o0;
                        fP += trackCornerSize3;
                    } else if (iOrdinal == 3) {
                        if (!this.f23258u0) {
                            f13 = this.f23250o0;
                            f23 += f13;
                            fP -= f13;
                        } else if (fArrL2[1] == 0.5f) {
                            f23 += this.f23250o0;
                        } else if (fArrL2[0] == 0.5f) {
                            i10 = this.f23250o0;
                        }
                    }
                    f10 = fP;
                    if (f23 < f10) {
                        rectF3.setEmpty();
                        f11 = f23;
                        f12 = f10;
                    } else {
                        float f24 = this.f23237j0 / 2.0f;
                        rectF3.set(f23, f14 - f24, f10, f24 + f14);
                        f11 = f23;
                        f12 = f10;
                        H(canvas, this.f23212b, rectF3, trackCornerSize3, baseSlider$FullCornerDirection);
                    }
                    i16++;
                    f23 = f11;
                    fP = f12;
                    i15 = 2;
                } else {
                    f23 -= trackCornerSize3;
                    i10 = this.f23250o0;
                }
                f13 = i10;
                fP -= f13;
                f10 = fP;
                if (f23 < f10) {
                }
                i16++;
                f23 = f11;
                fP = f12;
                i15 = 2;
            }
        }
        if (q() || r()) {
            i(canvas, rectF3, rectF);
        } else {
            i(canvas, rectF3, rectF2);
        }
        float[] fArr = this.M0;
        if (fArr == null || fArr.length == 0) {
            i11 = 2;
        } else {
            float[] fArrL3 = l();
            int iCeil = (int) Math.ceil(((this.M0.length / 2.0f) - 1.0f) * fArrL3[0]);
            int iFloor = (int) Math.floor(((this.M0.length / 2.0f) - 1.0f) * fArrL3[1]);
            Paint paint = this.f23221e;
            if (iCeil > 0) {
                h(0, iCeil * 2, canvas, paint);
            }
            i11 = 2;
            if (iCeil <= iFloor) {
                h(iCeil * 2, (iFloor + 1) * 2, canvas, this.f23224f);
            }
            int i17 = (iFloor + 1) * 2;
            float[] fArr2 = this.M0;
            if (i17 < fArr2.length) {
                h(i17, fArr2.length, canvas, paint);
            }
        }
        if (this.f23255r0 > 0 && !this.I0.isEmpty()) {
            float fFloatValue = ((Float) u1.e(this.I0, 1)).floatValue();
            float f25 = this.H0;
            if (fFloatValue < f25) {
                f(canvas, P(f25), f14);
            }
            if (this.f23258u0 || (this.I0.size() > 1 && ((Float) this.I0.get(0)).floatValue() > this.G0)) {
                f(canvas, P(this.G0), f14);
            }
        }
        if ((this.F0 || isFocused()) && isEnabled()) {
            int i18 = this.Q0;
            if (!(getBackground() instanceof RippleDrawable)) {
                float[] fArr3 = new float[i11];
                fArr3[0] = (u(((Float) this.I0.get(this.K0)).floatValue()) * i18) + this.f23240k0;
                fArr3[1] = f14;
                if (r()) {
                    this.f23229g1.mapPoints(fArr3);
                }
                if (Build.VERSION.SDK_INT < 28) {
                    float f26 = fArr3[0];
                    float f27 = this.f23248n0;
                    float f28 = fArr3[1];
                    canvas.clipRect(f26 - f27, f28 - f27, f26 + f27, f28 + f27, Region.Op.UNION);
                }
                canvas.drawCircle(fArr3[0], fArr3[1], this.f23248n0, this.f23218d);
            }
        }
        D();
        int i19 = this.Q0;
        for (int i20 = 0; i20 < this.I0.size(); i20++) {
            float fFloatValue2 = ((Float) this.I0.get(i20)).floatValue();
            Drawable drawable = this.customThumbDrawable;
            if (drawable != null) {
                g(canvas, i19, iC, fFloatValue2, drawable);
            } else if (i20 < this.f23235i1.size()) {
                g(canvas, i19, iC, fFloatValue2, (Drawable) this.f23235i1.get(i20));
            } else {
                if (!isEnabled()) {
                    canvas.drawCircle((u(fFloatValue2) * i19) + this.f23240k0, f14, getThumbRadius(), this.f23215c);
                }
                g(canvas, i19, iC, fFloatValue2, this.f23232h1);
            }
        }
    }

    @Override // android.view.View
    public void onFocusChanged(boolean z10, int i10, @Nullable Rect rect) {
        super.onFocusChanged(z10, i10, rect);
        v9.c cVar = this.f23230h;
        if (!z10) {
            this.J0 = -1;
            cVar.h(this.K0);
            return;
        }
        if (i10 == 1) {
            s(Integer.MAX_VALUE);
        } else if (i10 == 2) {
            s(Integer.MIN_VALUE);
        } else if (i10 == 17) {
            t(Integer.MAX_VALUE);
        } else if (i10 == 66) {
            t(Integer.MIN_VALUE);
        }
        cVar.t(this.K0);
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setVisibleToUser(false);
    }

    @Override // android.view.View, android.view.KeyEvent.Callback
    public final boolean onKeyDown(int i10, KeyEvent keyEvent) {
        if (!isEnabled()) {
            return super.onKeyDown(i10, keyEvent);
        }
        if (this.I0.size() == 1) {
            this.J0 = 0;
        }
        if (this.J0 == -1) {
            Boolean boolOnKeyDownNoActiveThumb = onKeyDownNoActiveThumb(i10, keyEvent);
            return boolOnKeyDownNoActiveThumb != null ? boolOnKeyDownNoActiveThumb.booleanValue() : super.onKeyDown(i10, keyEvent);
        }
        this.R0 |= keyEvent.isLongPress();
        Float fCalculateIncrementForKey = calculateIncrementForKey(i10);
        if (fCalculateIncrementForKey != null) {
            if (z(fCalculateIncrementForKey.floatValue() + ((Float) this.I0.get(this.J0)).floatValue(), this.J0)) {
                C();
                postInvalidate();
            }
            return true;
        }
        if (i10 != 23) {
            if (i10 == 61) {
                if (keyEvent.hasNoModifiers()) {
                    return s(1);
                }
                if (keyEvent.isShiftPressed()) {
                    return s(-1);
                }
                return false;
            }
            if (i10 != 66) {
                return super.onKeyDown(i10, keyEvent);
            }
        }
        this.J0 = -1;
        postInvalidate();
        return true;
    }

    @Override // android.view.View, android.view.KeyEvent.Callback
    public final boolean onKeyUp(int i10, KeyEvent keyEvent) {
        this.R0 = false;
        return super.onKeyUp(i10, keyEvent);
    }

    @Override // android.view.View
    public final void onMeasure(int i10, int i11) {
        int i12 = this.f23234i0;
        int iMakeMeasureSpec = View.MeasureSpec.makeMeasureSpec(this.f23231h0 + ((i12 == 1 || i12 == 3) ? ((y9.a) this.f23242l.get(0)).getIntrinsicHeight() : 0), 1073741824);
        if (r()) {
            super.onMeasure(iMakeMeasureSpec, i11);
        } else {
            super.onMeasure(i10, iMakeMeasureSpec);
        }
    }

    @Override // android.view.View
    public void onRestoreInstanceState(Parcelable parcelable) {
        d dVar = (d) parcelable;
        super.onRestoreInstanceState(dVar.getSuperState());
        this.G0 = dVar.f33765a;
        this.H0 = dVar.f33766b;
        y(dVar.f33767c);
        this.L0 = dVar.f33768d;
        if (dVar.f33769e) {
            requestFocus();
        }
    }

    @Override // android.view.View
    public Parcelable onSaveInstanceState() {
        d dVar = new d(super.onSaveInstanceState());
        dVar.f33765a = this.G0;
        dVar.f33766b = this.H0;
        dVar.f33767c = new ArrayList(this.I0);
        dVar.f33768d = this.L0;
        dVar.f33769e = hasFocus();
        return dVar;
    }

    @Override // android.view.View
    public final void onSizeChanged(int i10, int i11, int i12, int i13) {
        if (r()) {
            i10 = i11;
        }
        this.Q0 = Math.max(i10 - (this.f23240k0 * 2), 0);
        F();
        C();
    }

    /* JADX WARN: Removed duplicated region for block: B:43:0x00af  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean onTouchEvent(MotionEvent motionEvent) {
        int i10;
        if (!isEnabled()) {
            return false;
        }
        float y10 = r() ? motionEvent.getY() : motionEvent.getX();
        float x10 = r() ? motionEvent.getX() : motionEvent.getY();
        float f10 = (y10 - this.f23240k0) / this.Q0;
        this.f23238j1 = f10;
        float fMax = Math.max(0.0f, f10);
        this.f23238j1 = fMax;
        this.f23238j1 = Math.min(1.0f, fMax);
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked != 0) {
            int i11 = this.U;
            if (actionMasked == 1) {
                this.F0 = false;
                MotionEvent motionEvent2 = this.E0;
                if (motionEvent2 != null && motionEvent2.getActionMasked() == 0) {
                    float f11 = i11;
                    if (Math.abs(this.E0.getX() - motionEvent.getX()) <= f11 && Math.abs(this.E0.getY() - motionEvent.getY()) <= f11 && w()) {
                        v();
                    }
                }
                if (this.J0 != -1) {
                    A();
                    C();
                    if (this.f23250o0 > 0 && (i10 = this.f23252p0) != -1 && this.f23254q0 != -1) {
                        setThumbWidth(i10);
                        setThumbTrackGapSize(this.f23254q0);
                    }
                    this.J0 = -1;
                    Iterator it = this.Q.iterator();
                    if (it.hasNext()) {
                        u1.x(it.next());
                        throw null;
                    }
                }
                invalidate();
            } else if (actionMasked != 2) {
                if (actionMasked == 3) {
                }
            } else if (this.F0) {
                A();
                C();
                invalidate();
            } else {
                if (!r() && p(motionEvent) && Math.abs(y10 - this.C0) < i11) {
                    return false;
                }
                if (r() && o(motionEvent) && Math.abs(x10 - this.D0) < i11 * 0.8f) {
                    return false;
                }
                getParent().requestDisallowInterceptTouchEvent(true);
                if (w()) {
                    this.F0 = true;
                    E();
                    v();
                    A();
                    C();
                    invalidate();
                }
            }
        } else {
            this.C0 = y10;
            this.D0 = x10;
            if ((r() || !p(motionEvent)) && (!r() || !o(motionEvent))) {
                getParent().requestDisallowInterceptTouchEvent(true);
                if (w()) {
                    requestFocus();
                    this.F0 = true;
                    E();
                    v();
                    A();
                    C();
                    invalidate();
                }
            }
        }
        setPressed(this.F0);
        this.E0 = MotionEvent.obtain(motionEvent);
        return true;
    }

    @Override // android.view.View
    public final void onVisibilityAggregated(boolean z10) {
        super.onVisibilityAggregated(z10);
        this.f23253p1 = z10;
    }

    @Override // android.view.View
    public final void onVisibilityChanged(View view, int i10) {
        ViewOverlay contentViewOverlay;
        super.onVisibilityChanged(view, i10);
        if (i10 == 0 || (contentViewOverlay = getContentViewOverlay()) == null) {
            return;
        }
        Iterator it = this.f23242l.iterator();
        while (it.hasNext()) {
            contentViewOverlay.remove((y9.a) it.next());
        }
    }

    public final boolean p(MotionEvent motionEvent) {
        if (motionEvent.getToolType(0) == 3) {
            return false;
        }
        for (ViewParent parent = getParent(); parent instanceof ViewGroup; parent = parent.getParent()) {
            ViewGroup viewGroup = (ViewGroup) parent;
            if ((viewGroup.canScrollVertically(1) || viewGroup.canScrollVertically(-1)) && viewGroup.shouldDelayChildPressedState()) {
                return true;
            }
        }
        return false;
    }

    public final boolean q() {
        return getLayoutDirection() == 1;
    }

    public final boolean r() {
        return this.f23225f0 == 1;
    }

    public final boolean s(int i10) {
        int i11 = this.K0;
        long j10 = ((long) i11) + ((long) i10);
        long size = this.I0.size() - 1;
        if (j10 < 0) {
            j10 = 0;
        } else if (j10 > size) {
            j10 = size;
        }
        int i12 = (int) j10;
        this.K0 = i12;
        if (i12 == i11) {
            return false;
        }
        if (this.J0 != -1) {
            this.J0 = i12;
        }
        C();
        postInvalidate();
        return true;
    }

    public void setActiveThumbIndex(int i10) {
        this.J0 = i10;
    }

    public void setCentered(boolean z10) {
        if (this.f23258u0 == z10) {
            return;
        }
        this.f23258u0 = z10;
        if (z10) {
            setValues(Float.valueOf((this.G0 + this.H0) / 2.0f));
        } else {
            setValues(Float.valueOf(this.G0));
        }
        M(true);
    }

    public void setCustomThumbDrawable(Drawable drawable) {
        Drawable drawableNewDrawable = drawable.mutate().getConstantState().newDrawable();
        b(drawableNewDrawable);
        this.customThumbDrawable = drawableNewDrawable;
        this.f23235i1.clear();
        postInvalidate();
    }

    public void setCustomThumbDrawablesForValues(@NonNull @DrawableRes int... iArr) {
        Drawable[] drawableArr = new Drawable[iArr.length];
        for (int i10 = 0; i10 < iArr.length; i10++) {
            drawableArr[i10] = getResources().getDrawable(iArr[i10]);
        }
        setCustomThumbDrawablesForValues(drawableArr);
    }

    @Override // android.view.View
    public void setEnabled(boolean z10) {
        super.setEnabled(z10);
        setLayerType(z10 ? 0 : 2, null);
    }

    public void setFocusedThumbIndex(int i10) {
        if (i10 < 0 || i10 >= this.I0.size()) {
            throw new IllegalArgumentException("index out of range");
        }
        this.K0 = i10;
        this.f23230h.t(i10);
        postInvalidate();
    }

    public void setHaloRadius(int i10) {
        if (i10 == this.f23248n0) {
            return;
        }
        this.f23248n0 = i10;
        Drawable background = getBackground();
        if ((!(getBackground() instanceof RippleDrawable)) || !(background instanceof RippleDrawable)) {
            postInvalidate();
        } else {
            j9.c.setRippleDrawableRadius((RippleDrawable) background, this.f23248n0);
        }
    }

    public void setHaloTintList(ColorStateList colorStateList) {
        if (colorStateList.equals(this.T0)) {
            return;
        }
        this.T0 = colorStateList;
        Drawable background = getBackground();
        if (!(!(getBackground() instanceof RippleDrawable)) && (background instanceof RippleDrawable)) {
            ((RippleDrawable) background).setColor(colorStateList);
            return;
        }
        int iM = m(colorStateList);
        Paint paint = this.f23218d;
        paint.setColor(iM);
        paint.setAlpha(63);
        invalidate();
    }

    public void setLabelBehavior(int i10) {
        if (this.f23234i0 != i10) {
            this.f23234i0 = i10;
            M(true);
        }
    }

    public void setLabelFormatter(@Nullable v9.e eVar) {
    }

    public void setOrientation(int i10) {
        if (this.f23225f0 == i10) {
            return;
        }
        this.f23225f0 = i10;
        M(true);
    }

    public void setSeparationUnit(int i10) {
        this.f23241k1 = i10;
        this.S0 = true;
        postInvalidate();
    }

    public void setStepSize(float f10) {
        if (f10 < 0.0f) {
            throw new IllegalArgumentException(String.format("The stepSize(%s) must be 0, or a factor of the valueFrom(%s)-valueTo(%s) range", Float.valueOf(f10), Float.valueOf(this.G0), Float.valueOf(this.H0)));
        }
        if (this.L0 != f10) {
            this.L0 = f10;
            this.S0 = true;
            postInvalidate();
        }
    }

    public void setThumbElevation(float f10) {
        this.f23232h1.w(f10);
    }

    public void setThumbHeight(int i10) {
        if (i10 == this.f23246m0) {
            return;
        }
        this.f23246m0 = i10;
        this.f23232h1.setBounds(0, 0, this.f23243l0, i10);
        Drawable drawable = this.customThumbDrawable;
        if (drawable != null) {
            b(drawable);
        }
        Iterator it = this.f23235i1.iterator();
        while (it.hasNext()) {
            b((Drawable) it.next());
        }
        M(false);
    }

    public void setThumbRadius(int i10) {
        int i11 = i10 * 2;
        setThumbWidth(i11);
        setThumbHeight(i11);
    }

    public void setThumbStrokeColor(@Nullable ColorStateList colorStateList) {
        this.f23232h1.setStrokeColor(colorStateList);
        postInvalidate();
    }

    public void setThumbStrokeWidth(float f10) {
        this.f23232h1.D(f10);
        postInvalidate();
    }

    public void setThumbTrackGapSize(int i10) {
        if (this.f23250o0 == i10) {
            return;
        }
        this.f23250o0 = i10;
        invalidate();
    }

    public void setThumbWidth(int i10) {
        if (i10 == this.f23243l0) {
            return;
        }
        this.f23243l0 = i10;
        q qVar = new q();
        h hVarB = f.b(0);
        qVar.f23134a = hVarB;
        q.b(hVarB);
        qVar.f23135b = hVarB;
        q.b(hVarB);
        qVar.f23136c = hVarB;
        q.b(hVarB);
        qVar.f23137d = hVarB;
        q.b(hVarB);
        qVar.c(this.f23243l0 / 2.0f);
        com.google.android.material.shape.s sVarA = qVar.a();
        k kVar = this.f23232h1;
        kVar.setShapeAppearanceModel(sVarA);
        kVar.setBounds(0, 0, this.f23243l0, this.f23246m0);
        Drawable drawable = this.customThumbDrawable;
        if (drawable != null) {
            b(drawable);
        }
        Iterator it = this.f23235i1.iterator();
        while (it.hasNext()) {
            b((Drawable) it.next());
        }
        M(false);
    }

    public void setTickActiveRadius(int i10) {
        if (this.O0 != i10) {
            this.O0 = i10;
            this.f23224f.setStrokeWidth(i10 * 2);
            M(false);
        }
    }

    public void setTickActiveTintList(ColorStateList colorStateList) {
        if (colorStateList.equals(this.U0)) {
            return;
        }
        this.U0 = colorStateList;
        this.f23224f.setColor(m(colorStateList));
        invalidate();
    }

    public void setTickInactiveRadius(int i10) {
        if (this.P0 != i10) {
            this.P0 = i10;
            this.f23221e.setStrokeWidth(i10 * 2);
            M(false);
        }
    }

    public void setTickInactiveTintList(ColorStateList colorStateList) {
        if (colorStateList.equals(this.V0)) {
            return;
        }
        this.V0 = colorStateList;
        this.f23221e.setColor(m(colorStateList));
        invalidate();
    }

    public void setTickVisibilityMode(int i10) {
        if (this.N0 != i10) {
            this.N0 = i10;
            postInvalidate();
        }
    }

    public void setTrackActiveTintList(ColorStateList colorStateList) {
        if (colorStateList.equals(this.W0)) {
            return;
        }
        this.W0 = colorStateList;
        this.f23212b.setColor(m(colorStateList));
        invalidate();
    }

    public void setTrackCornerSize(int i10) {
        if (this.f23256s0 == i10) {
            return;
        }
        this.f23256s0 = i10;
        invalidate();
    }

    public void setTrackHeight(int i10) {
        if (this.f23237j0 != i10) {
            this.f23237j0 = i10;
            this.f23210a.setStrokeWidth(i10);
            this.f23212b.setStrokeWidth(this.f23237j0);
            M(false);
        }
    }

    public void setTrackIconActiveColor(@Nullable ColorStateList colorStateList) {
        if (colorStateList == this.trackIconActiveColor) {
            return;
        }
        this.trackIconActiveColor = colorStateList;
        J();
        I();
        invalidate();
    }

    public void setTrackIconActiveEnd(@Nullable Drawable drawable) {
        if (drawable == this.trackIconActiveEnd) {
            return;
        }
        this.trackIconActiveEnd = drawable;
        this.f23260w0 = false;
        I();
        invalidate();
    }

    public void setTrackIconActiveStart(@Nullable Drawable drawable) {
        if (drawable == this.trackIconActiveStart) {
            return;
        }
        this.trackIconActiveStart = drawable;
        this.f23259v0 = false;
        J();
        invalidate();
    }

    public void setTrackIconInactiveColor(@Nullable ColorStateList colorStateList) {
        if (colorStateList == this.trackIconInactiveColor) {
            return;
        }
        this.trackIconInactiveColor = colorStateList;
        L();
        K();
        invalidate();
    }

    public void setTrackIconInactiveEnd(@Nullable Drawable drawable) {
        if (drawable == this.trackIconInactiveEnd) {
            return;
        }
        this.trackIconInactiveEnd = drawable;
        this.f23262y0 = false;
        K();
        invalidate();
    }

    public void setTrackIconInactiveStart(@Nullable Drawable drawable) {
        if (drawable == this.trackIconInactiveStart) {
            return;
        }
        this.trackIconInactiveStart = drawable;
        this.f23261x0 = false;
        L();
        invalidate();
    }

    public void setTrackIconSize(int i10) {
        if (this.z0 == i10) {
            return;
        }
        this.z0 = i10;
        invalidate();
    }

    public void setTrackInactiveTintList(ColorStateList colorStateList) {
        if (colorStateList.equals(this.X0)) {
            return;
        }
        this.X0 = colorStateList;
        this.f23210a.setColor(m(colorStateList));
        invalidate();
    }

    public void setTrackInsideCornerSize(int i10) {
        if (this.f23257t0 == i10) {
            return;
        }
        this.f23257t0 = i10;
        invalidate();
    }

    public void setTrackStopIndicatorSize(int i10) {
        if (this.f23255r0 == i10) {
            return;
        }
        this.f23255r0 = i10;
        this.f23227g.setStrokeWidth(i10);
        invalidate();
    }

    public void setValues(@NonNull Float... fArr) {
        ArrayList arrayList = new ArrayList();
        Collections.addAll(arrayList, fArr);
        y(arrayList);
    }

    public final void t(int i10) {
        if (q() || r()) {
            i10 = i10 == Integer.MIN_VALUE ? Integer.MAX_VALUE : -i10;
        }
        s(i10);
    }

    public final float u(float f10) {
        float f11 = this.G0;
        float f12 = (f10 - f11) / (this.H0 - f11);
        return (q() || r()) ? 1.0f - f12 : f12;
    }

    public final void v() {
        Iterator it = this.Q.iterator();
        if (it.hasNext()) {
            u1.x(it.next());
            throw null;
        }
    }

    public boolean w() {
        if (this.J0 != -1) {
            return true;
        }
        float f10 = this.f23238j1;
        if (q() || r()) {
            f10 = 1.0f - f10;
        }
        float f11 = this.H0;
        float f12 = this.G0;
        float fA = u1.a(f11, f12, f10, f12);
        float fP = P(fA);
        this.J0 = 0;
        float fAbs = Math.abs(((Float) this.I0.get(0)).floatValue() - fA);
        for (int i10 = 1; i10 < this.I0.size(); i10++) {
            float fAbs2 = Math.abs(((Float) this.I0.get(i10)).floatValue() - fA);
            float fP2 = P(((Float) this.I0.get(i10)).floatValue());
            if (Float.compare(fAbs2, fAbs) > 0) {
                break;
            }
            boolean z10 = q() || r() ? fP2 - fP > 0.0f : fP2 - fP < 0.0f;
            if (Float.compare(fAbs2, fAbs) < 0) {
                this.J0 = i10;
            } else {
                if (Float.compare(fAbs2, fAbs) != 0) {
                    continue;
                } else {
                    if (Math.abs(fP2 - fP) < this.U) {
                        this.J0 = -1;
                        return false;
                    }
                    if (z10) {
                        this.J0 = i10;
                    }
                }
            }
            fAbs = fAbs2;
        }
        return this.J0 != -1;
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x0098  */
    /* JADX WARN: Removed duplicated region for block: B:19:0x00b5 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:20:0x00b6  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void x(y9.a aVar, float f10) {
        int iU;
        int intrinsicWidth;
        int iC;
        int intrinsicHeight;
        int iC2;
        ViewOverlay contentViewOverlay;
        aVar.setText(String.format(((float) ((int) f10)) == f10 ? "%.0f" : "%.2f", Float.valueOf(f10)));
        if (r()) {
            iU = (this.f23240k0 + ((int) (u(f10) * this.Q0))) - (aVar.getIntrinsicHeight() / 2);
            intrinsicWidth = aVar.getIntrinsicHeight() + iU;
            if (!q()) {
                iC2 = (this.f23246m0 / 2) + this.B0 + c();
                iC = aVar.getIntrinsicWidth() + iC2;
                Rect rect = this.f23220d1;
                rect.set(iU, iC2, intrinsicWidth, iC);
                if (r()) {
                    RectF rectF = new RectF(rect);
                    this.f23229g1.mapRect(rectF);
                    rectF.round(rect);
                }
                g.c(w0.getContentView(this), this, rect);
                aVar.setBounds(rect);
                contentViewOverlay = getContentViewOverlay();
                if (contentViewOverlay != null) {
                    return;
                }
                contentViewOverlay.add(aVar);
                return;
            }
            iC = c() - ((this.f23246m0 / 2) + this.B0);
            intrinsicHeight = aVar.getIntrinsicWidth();
        } else {
            iU = (this.f23240k0 + ((int) (u(f10) * this.Q0))) - (aVar.getIntrinsicWidth() / 2);
            intrinsicWidth = aVar.getIntrinsicWidth() + iU;
            iC = c() - ((this.f23246m0 / 2) + this.B0);
            intrinsicHeight = aVar.getIntrinsicHeight();
        }
        iC2 = iC - intrinsicHeight;
        Rect rect2 = this.f23220d1;
        rect2.set(iU, iC2, intrinsicWidth, iC);
        if (r()) {
        }
        g.c(w0.getContentView(this), this, rect2);
        aVar.setBounds(rect2);
        contentViewOverlay = getContentViewOverlay();
        if (contentViewOverlay != null) {
        }
    }

    public final void y(ArrayList arrayList) {
        ViewGroup contentView;
        if (arrayList.isEmpty()) {
            throw new IllegalArgumentException("At least one value must be set");
        }
        Collections.sort(arrayList);
        if (this.I0.size() == arrayList.size() && this.I0.equals(arrayList)) {
            return;
        }
        this.I0 = arrayList;
        this.S0 = true;
        this.K0 = 0;
        C();
        ArrayList arrayList2 = this.f23242l;
        if (arrayList2.size() > this.I0.size()) {
            List<y9.a> listSubList = arrayList2.subList(this.I0.size(), arrayList2.size());
            for (y9.a aVar : listSubList) {
                if (isAttachedToWindow() && (contentView = w0.getContentView(this)) != null) {
                    contentView.getOverlay().remove(aVar);
                    aVar.detachView(contentView);
                }
            }
            listSubList.clear();
        }
        while (arrayList2.size() < this.I0.size()) {
            y9.a aVarCreateFromAttributes = y9.a.createFromAttributes(getContext(), null, 0, this.f23239k);
            arrayList2.add(aVarCreateFromAttributes);
            if (isAttachedToWindow()) {
                aVarCreateFromAttributes.setRelativeToView(w0.getContentView(this));
            }
        }
        int i10 = arrayList2.size() == 1 ? 0 : 1;
        Iterator it = arrayList2.iterator();
        while (it.hasNext()) {
            ((y9.a) it.next()).D(i10);
        }
        Iterator it2 = this.f23245m.iterator();
        while (it2.hasNext()) {
            u1.x(it2.next());
            Iterator it3 = this.I0.iterator();
            if (it3.hasNext()) {
                ((Float) it3.next()).floatValue();
                throw null;
            }
        }
        postInvalidate();
    }

    public final boolean z(float f10, int i10) {
        this.K0 = i10;
        int i11 = 0;
        if (Math.abs(f10 - ((Float) this.I0.get(i10)).floatValue()) < 1.0E-4d) {
            return false;
        }
        float minSeparation = getMinSeparation();
        if (this.f23241k1 == 0) {
            if (minSeparation == 0.0f) {
                minSeparation = 0.0f;
            } else {
                float f11 = this.G0;
                minSeparation = u1.a(f11, this.H0, (minSeparation - this.f23240k0) / this.Q0, f11);
            }
        }
        if (q() || r()) {
            minSeparation = -minSeparation;
        }
        int i12 = i10 + 1;
        int i13 = i10 - 1;
        this.I0.set(i10, Float.valueOf(y.f(f10, i13 < 0 ? this.G0 : minSeparation + ((Float) this.I0.get(i13)).floatValue(), i12 >= this.I0.size() ? this.H0 : ((Float) this.I0.get(i12)).floatValue() - minSeparation)));
        Iterator it = this.f23245m.iterator();
        if (it.hasNext()) {
            u1.x(it.next());
            ((Float) this.I0.get(i10)).floatValue();
            throw null;
        }
        AccessibilityManager accessibilityManager = this.f23233i;
        if (accessibilityManager == null || !accessibilityManager.isEnabled()) {
            return true;
        }
        Runnable runnable = this.f23236j;
        if (runnable == null) {
            this.f23236j = new s(this, i11);
        } else {
            removeCallbacks(runnable);
        }
        s sVar = this.f23236j;
        sVar.f36800b = i10;
        postDelayed(sVar, 200L);
        return true;
    }

    /* JADX WARN: Illegal instructions before constructor call */
    /* JADX WARN: Type inference failed for: r0v11, types: [v9.a] */
    /* JADX WARN: Type inference failed for: r0v12, types: [v9.b] */
    public a(@NonNull Context context, @Nullable AttributeSet attributeSet, int i10) {
        int i11 = f23205q1;
        super(x9.a.wrap(context, attributeSet, i10, i11), attributeSet, i10);
        this.f23242l = new ArrayList();
        this.f23245m = new ArrayList();
        this.Q = new ArrayList();
        this.R = false;
        this.f23252p0 = -1;
        this.f23254q0 = -1;
        this.f23258u0 = false;
        this.f23259v0 = false;
        this.f23260w0 = false;
        this.f23261x0 = false;
        this.f23262y0 = false;
        this.F0 = false;
        this.I0 = new ArrayList();
        this.J0 = -1;
        this.K0 = -1;
        this.L0 = 0.0f;
        this.R0 = false;
        this.Y0 = new Path();
        this.Z0 = new RectF();
        this.a1 = new RectF();
        this.f23214b1 = new RectF();
        this.f23217c1 = new RectF();
        this.f23220d1 = new Rect();
        this.f23223e1 = new RectF();
        this.f23226f1 = new Rect();
        this.f23229g1 = new Matrix();
        k kVar = new k();
        this.f23232h1 = kVar;
        this.f23235i1 = Collections.emptyList();
        this.f23241k1 = 0;
        this.f23247m1 = new ViewTreeObserver.OnScrollChangedListener() { // from class: v9.a
            @Override // android.view.ViewTreeObserver.OnScrollChangedListener
            public final void onScrollChanged() {
                this.f33761a.D();
            }
        };
        this.f23249n1 = new ViewTreeObserver.OnGlobalLayoutListener() { // from class: v9.b
            @Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
            public final void onGlobalLayout() {
                this.f33762a.D();
            }
        };
        this.f23251o1 = new y.a(this, 14);
        Context context2 = getContext();
        this.f23253p1 = isShown();
        this.f23210a = new Paint();
        this.f23212b = new Paint();
        Paint paint = new Paint(1);
        this.f23215c = paint;
        Paint.Style style = Paint.Style.FILL;
        paint.setStyle(style);
        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
        Paint paint2 = new Paint(1);
        this.f23218d = paint2;
        paint2.setStyle(style);
        Paint paint3 = new Paint();
        this.f23221e = paint3;
        Paint.Style style2 = Paint.Style.STROKE;
        paint3.setStyle(style2);
        Paint.Cap cap = Paint.Cap.ROUND;
        paint3.setStrokeCap(cap);
        Paint paint4 = new Paint();
        this.f23224f = paint4;
        paint4.setStyle(style2);
        paint4.setStrokeCap(cap);
        Paint paint5 = new Paint();
        this.f23227g = paint5;
        paint5.setStyle(style);
        paint5.setStrokeCap(cap);
        Resources resources = context2.getResources();
        this.f23228g0 = resources.getDimensionPixelSize(x8.e.mtrl_slider_widget_height);
        int dimensionPixelOffset = resources.getDimensionPixelOffset(x8.e.mtrl_slider_track_side_padding);
        this.V = dimensionPixelOffset;
        this.f23240k0 = dimensionPixelOffset;
        this.W = resources.getDimensionPixelSize(x8.e.mtrl_slider_thumb_radius);
        this.f23211a0 = resources.getDimensionPixelSize(x8.e.mtrl_slider_track_height);
        int i12 = x8.e.mtrl_slider_tick_radius;
        this.f23213b0 = resources.getDimensionPixelSize(i12);
        this.f23216c0 = resources.getDimensionPixelSize(i12);
        this.f23219d0 = resources.getDimensionPixelSize(x8.e.mtrl_slider_tick_min_spacing);
        this.B0 = resources.getDimensionPixelSize(x8.e.mtrl_slider_label_padding);
        this.A0 = resources.getDimensionPixelOffset(x8.e.m3_slider_track_icon_padding);
        TypedArray typedArrayC = q0.c(context2, attributeSet, m.Slider, i10, i11, new int[0]);
        setOrientation(typedArrayC.getInt(m.Slider_android_orientation, 0));
        this.f23239k = typedArrayC.getResourceId(m.Slider_labelStyle, l.Widget_MaterialComponents_Tooltip);
        this.G0 = typedArrayC.getFloat(m.Slider_android_valueFrom, 0.0f);
        this.H0 = typedArrayC.getFloat(m.Slider_android_valueTo, 1.0f);
        setValues(Float.valueOf(this.G0));
        setCentered(typedArrayC.getBoolean(m.Slider_centered, false));
        this.L0 = typedArrayC.getFloat(m.Slider_android_stepSize, 0.0f);
        this.f23222e0 = (int) Math.ceil(typedArrayC.getDimension(m.Slider_minTouchTargetSize, q9.c.b(context2)));
        int i13 = m.Slider_trackColor;
        boolean zHasValue = typedArrayC.hasValue(i13);
        int i14 = zHasValue ? i13 : m.Slider_trackColorInactive;
        i13 = zHasValue ? i13 : m.Slider_trackColorActive;
        ColorStateList colorStateList = q9.d.getColorStateList(context2, typedArrayC, i14);
        setTrackInactiveTintList(colorStateList == null ? g0.d.getColorStateList(context2, x8.d.material_slider_inactive_track_color) : colorStateList);
        ColorStateList colorStateList2 = q9.d.getColorStateList(context2, typedArrayC, i13);
        setTrackActiveTintList(colorStateList2 == null ? g0.d.getColorStateList(context2, x8.d.material_slider_active_track_color) : colorStateList2);
        kVar.setFillColor(q9.d.getColorStateList(context2, typedArrayC, m.Slider_thumbColor));
        int i15 = m.Slider_thumbStrokeColor;
        if (typedArrayC.hasValue(i15)) {
            setThumbStrokeColor(q9.d.getColorStateList(context2, typedArrayC, i15));
        }
        setThumbStrokeWidth(typedArrayC.getDimension(m.Slider_thumbStrokeWidth, 0.0f));
        ColorStateList colorStateList3 = q9.d.getColorStateList(context2, typedArrayC, m.Slider_haloColor);
        setHaloTintList(colorStateList3 == null ? g0.d.getColorStateList(context2, x8.d.material_slider_halo_color) : colorStateList3);
        int i16 = m.Slider_tickVisibilityMode;
        this.N0 = typedArrayC.hasValue(i16) ? typedArrayC.getInt(i16, -1) : typedArrayC.getBoolean(m.Slider_tickVisible, true) ? 0 : 2;
        int i17 = m.Slider_tickColor;
        boolean zHasValue2 = typedArrayC.hasValue(i17);
        int i18 = zHasValue2 ? i17 : m.Slider_tickColorInactive;
        i17 = zHasValue2 ? i17 : m.Slider_tickColorActive;
        ColorStateList colorStateList4 = q9.d.getColorStateList(context2, typedArrayC, i18);
        setTickInactiveTintList(colorStateList4 == null ? g0.d.getColorStateList(context2, x8.d.material_slider_inactive_tick_marks_color) : colorStateList4);
        ColorStateList colorStateList5 = q9.d.getColorStateList(context2, typedArrayC, i17);
        setTickActiveTintList(colorStateList5 == null ? g0.d.getColorStateList(context2, x8.d.material_slider_active_tick_marks_color) : colorStateList5);
        setThumbTrackGapSize(typedArrayC.getDimensionPixelSize(m.Slider_thumbTrackGapSize, 0));
        setTrackStopIndicatorSize(typedArrayC.getDimensionPixelSize(m.Slider_trackStopIndicatorSize, 0));
        setTrackCornerSize(typedArrayC.getDimensionPixelSize(m.Slider_trackCornerSize, -1));
        setTrackInsideCornerSize(typedArrayC.getDimensionPixelSize(m.Slider_trackInsideCornerSize, 0));
        setTrackIconActiveStart(q9.d.getDrawable(context2, typedArrayC, m.Slider_trackIconActiveStart));
        setTrackIconActiveEnd(q9.d.getDrawable(context2, typedArrayC, m.Slider_trackIconActiveEnd));
        setTrackIconActiveColor(q9.d.getColorStateList(context2, typedArrayC, m.Slider_trackIconActiveColor));
        setTrackIconInactiveStart(q9.d.getDrawable(context2, typedArrayC, m.Slider_trackIconInactiveStart));
        setTrackIconInactiveEnd(q9.d.getDrawable(context2, typedArrayC, m.Slider_trackIconInactiveEnd));
        setTrackIconInactiveColor(q9.d.getColorStateList(context2, typedArrayC, m.Slider_trackIconInactiveColor));
        setTrackIconSize(typedArrayC.getDimensionPixelSize(m.Slider_trackIconSize, 0));
        int dimensionPixelSize = typedArrayC.getDimensionPixelSize(m.Slider_thumbRadius, 0) * 2;
        int dimensionPixelSize2 = typedArrayC.getDimensionPixelSize(m.Slider_thumbWidth, dimensionPixelSize);
        int dimensionPixelSize3 = typedArrayC.getDimensionPixelSize(m.Slider_thumbHeight, dimensionPixelSize);
        setThumbWidth(dimensionPixelSize2);
        setThumbHeight(dimensionPixelSize3);
        setHaloRadius(typedArrayC.getDimensionPixelSize(m.Slider_haloRadius, 0));
        setThumbElevation(typedArrayC.getDimension(m.Slider_thumbElevation, 0.0f));
        setTrackHeight(typedArrayC.getDimensionPixelSize(m.Slider_trackHeight, 0));
        setTickActiveRadius(typedArrayC.getDimensionPixelSize(m.Slider_tickRadiusActive, this.f23255r0 / 2));
        setTickInactiveRadius(typedArrayC.getDimensionPixelSize(m.Slider_tickRadiusInactive, this.f23255r0 / 2));
        setLabelBehavior(typedArrayC.getInt(m.Slider_labelBehavior, 0));
        if (!typedArrayC.getBoolean(m.Slider_android_enabled, true)) {
            setEnabled(false);
        }
        typedArrayC.recycle();
        setFocusable(true);
        setClickable(true);
        kVar.B(2);
        this.U = ViewConfiguration.get(context2).getScaledTouchSlop();
        v9.c cVar = new v9.c(this);
        this.f23230h = cVar;
        s1.setAccessibilityDelegate(this, cVar);
        AccessibilityManager accessibilityManager = (AccessibilityManager) getContext().getSystemService("accessibility");
        this.f23233i = accessibilityManager;
        if (Build.VERSION.SDK_INT >= 29) {
            this.f23244l1 = accessibilityManager.getRecommendedTimeoutMillis(10000, 6);
        } else {
            this.f23244l1 = 120000;
        }
    }

    public void setValues(@NonNull List<Float> list) {
        y(new ArrayList(list));
    }

    public void setCustomThumbDrawablesForValues(@NonNull Drawable... drawableArr) {
        this.customThumbDrawable = null;
        this.f23235i1 = new ArrayList();
        for (Drawable drawable : drawableArr) {
            List list = this.f23235i1;
            Drawable drawableNewDrawable = drawable.mutate().getConstantState().newDrawable();
            b(drawableNewDrawable);
            list.add(drawableNewDrawable);
        }
        postInvalidate();
    }
}
