package androidx.constraintlayout.motion.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import androidx.constraintlayout.solver.widgets.ConstraintWidget;
import androidx.constraintlayout.widget.Barrier;
import androidx.constraintlayout.widget.ConstraintHelper;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Constraints;
import androidx.constraintlayout.widget.R$styleable;
import androidx.core.widget.NestedScrollView;
import com.facebook.internal.security.CertificateUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.ᨨ.AbstractC1767;
import ῲ.ⁱ.ʬ.C2059;
import ῲ.ⁱ.ʬ.C2065;
import ῲ.ⁱ.ʬ.C2068;
import ῲ.ⁱ.ῲ.㿎.AbstractC2105;
import ῲ.ⁱ.ῲ.㿎.C2082;
import ῲ.ⁱ.ῲ.㿎.C2083;
import ῲ.ⁱ.ῲ.㿎.C2100;
import ῲ.ⁱ.ῲ.㿎.C2102;
import ῲ.ⁱ.ῲ.㿎.C2103;
import ῲ.ⁱ.ῲ.㿎.C2106;
import ῲ.ⁱ.K.ῲ.AbstractC2113;
import ῲ.ⁱ.K.ῲ.AbstractC2140;
import ῲ.ⁱ.K.ῲ.Abstractanimation.InterpolatorC2160;
import ῲ.ⁱ.K.ῲ.C2110;
import ῲ.ⁱ.K.ῲ.C2112;
import ῲ.ⁱ.K.ῲ.C2129;
import ῲ.ⁱ.K.ῲ.C2130;
import ῲ.ⁱ.K.ῲ.C2131;
import ῲ.ⁱ.K.ῲ.C2139;
import ῲ.ⁱ.K.ῲ.C2165;
import ῲ.ⁱ.K.ῲ.View$OnTouchListenerC2111;
import ῲ.ⁱ.K.K.AbstractC2187;
import ῲ.ⁱ.K.K.C2184;
import ῲ.ⁱ.K.K.C2189;
import ῲ.ⁱ.K.K.C2194;
import K.K.K.ʬ.C2369;

public class MotionLayout extends ConstraintLayout implements AbstractC1767 {

    /* renamed from: 㳨  reason: contains not printable characters */
    public static boolean f691;

    /* renamed from: ʬ  reason: contains not printable characters */
    public Interpolator f692;

    /* renamed from: Ϸ  reason: contains not printable characters */
    public int f693;

    /* renamed from: В  reason: contains not printable characters */
    public float f694;

    /* renamed from: ѷ  reason: contains not printable characters */
    public float f695 = 0.0f;

    /* renamed from: ӯ  reason: contains not printable characters */
    public float f696;

    /* renamed from: Ԕ  reason: contains not printable characters */
    public float f697 = 0.0f;

    /* renamed from: Ԛ  reason: contains not printable characters */
    public float f698;

    /* renamed from: ؿ  reason: contains not printable characters */
    public long f699;

    /* renamed from: ݜ  reason: contains not printable characters */
    public boolean f700 = false;

    /* renamed from: ݰ  reason: contains not printable characters */
    public C0132 f701 = new C0132();

    /* renamed from: ࠋ  reason: contains not printable characters */
    public float f702 = 0.0f;

    /* renamed from: ࡔ  reason: contains not printable characters */
    public View f703 = null;

    /* renamed from: ಯ  reason: contains not printable characters */
    public ArrayList<MotionHelper> f704 = null;

    /* renamed from: ඓ  reason: contains not printable characters */
    public int f705 = -1;

    /* renamed from: ผ  reason: contains not printable characters */
    public boolean f706 = false;

    /* renamed from: ᆯ  reason: contains not printable characters */
    public boolean f707 = false;

    /* renamed from: ሽ  reason: contains not printable characters */
    public float f708;

    /* renamed from: ጒ  reason: contains not printable characters */
    public ArrayList<MotionHelper> f709 = null;

    /* renamed from: Ꮝ  reason: contains not printable characters */
    public int f710;

    /* renamed from: ᑓ  reason: contains not printable characters */
    public boolean f711 = false;

    /* renamed from: ᑾ  reason: contains not printable characters */
    public long f712;

    /* renamed from: ᓆ  reason: contains not printable characters */
    public int f713 = 0;

    /* renamed from: ᓣ  reason: contains not printable characters */
    public float f714 = 0.0f;

    /* renamed from: ᔝ  reason: contains not printable characters */
    public boolean f715 = false;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public HashMap<View, C2110> f716 = new HashMap<>();

    /* renamed from: ᝁ  reason: contains not printable characters */
    public int f717;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public int f718 = 0;

    /* renamed from: ᴊ  reason: contains not printable characters */
    public int f719;

    /* renamed from: ᶲ  reason: contains not printable characters */
    public int f720 = 0;

    /* renamed from: ῲ  reason: contains not printable characters */
    public C2131 f721;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public int f722 = -1;

    /* renamed from: ₱  reason: contains not printable characters */
    public TransitionState f723 = TransitionState.UNDEFINED;

    /* renamed from: ⶍ  reason: contains not printable characters */
    public float f724;

    /* renamed from: ゎ  reason: contains not printable characters */
    public C2189 f725 = new C2189();

    /* renamed from: を  reason: contains not printable characters */
    public boolean f726 = false;

    /* renamed from: ト  reason: contains not printable characters */
    public C0128 f727 = new C0128();

    /* renamed from: ピ  reason: contains not printable characters */
    public int f728;

    /* renamed from: 㑃  reason: contains not printable characters */
    public long f729 = 0;

    /* renamed from: 㒁  reason: contains not printable characters */
    public int f730 = 0;

    /* renamed from: 㓚  reason: contains not printable characters */
    public int f731;

    /* renamed from: 㗗  reason: contains not printable characters */
    public float f732 = 0.0f;

    /* renamed from: 㗼  reason: contains not printable characters */
    public C0129 f733;

    /* renamed from: 㗽  reason: contains not printable characters */
    public boolean f734;

    /* renamed from: 㗾  reason: contains not printable characters */
    public ArrayList<Integer> f735 = new ArrayList<>();

    /* renamed from: 㣙  reason: contains not printable characters */
    public RectF f736 = new RectF();

    /* renamed from: 㮔  reason: contains not printable characters */
    public C2139 f737;

    /* renamed from: 㮝  reason: contains not printable characters */
    public boolean f738 = false;

    /* renamed from: 㱶  reason: contains not printable characters */
    public int f739;

    /* renamed from: 㳳  reason: contains not printable characters */
    public boolean f740 = true;

    /* renamed from: 㴪  reason: contains not printable characters */
    public C0126 f741;

    /* renamed from: 㴹  reason: contains not printable characters */
    public int f742 = -1;

    /* renamed from: 㵟  reason: contains not printable characters */
    public C2129 f743 = new C2129();

    /* renamed from: 㶋  reason: contains not printable characters */
    public float f744;

    /* renamed from: 㷛  reason: contains not printable characters */
    public long f745 = -1;

    /* renamed from: 㸾  reason: contains not printable characters */
    public float f746 = 0.0f;

    /* renamed from: 㹎  reason: contains not printable characters */
    public ArrayList<AbstractC0133> f747 = null;

    /* renamed from: 㿎  reason: contains not printable characters */
    public int f748 = 0;

    /* renamed from: 䀟  reason: contains not printable characters */
    public AbstractC0133 f749;

    /* renamed from: 䁗  reason: contains not printable characters */
    public float f750 = 1.0f;

    /* renamed from: 䃖  reason: contains not printable characters */
    public int f751;

    public enum TransitionState {
        UNDEFINED,
        SETUP,
        MOVING,
        FINISHED
    }

    /* renamed from: androidx.constraintlayout.motion.widget.MotionLayout$ʬ  reason: contains not printable characters */
    public class C0126 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public float[] f753;

        /* renamed from: Ԕ  reason: contains not printable characters */
        public boolean f754 = false;

        /* renamed from: ඓ  reason: contains not printable characters */
        public Paint f756 = new Paint();

        /* renamed from: ᕣ  reason: contains not printable characters */
        public DashPathEffect f757;

        /* renamed from: ᨨ  reason: contains not printable characters */
        public Paint f758;

        /* renamed from: ῲ  reason: contains not printable characters */
        public int[] f759;

        /* renamed from: ⁱ  reason: contains not printable characters */
        public Paint f760;

        /* renamed from: K  reason: contains not printable characters */
        public float[] f761;

        /* renamed from: 㑃  reason: contains not printable characters */
        public int f762;

        /* renamed from: 㗗  reason: contains not printable characters */
        public int f763 = 1;

        /* renamed from: 㳳  reason: contains not printable characters */
        public float[] f764;

        /* renamed from: 㴹  reason: contains not printable characters */
        public Paint f765;

        /* renamed from: 㸾  reason: contains not printable characters */
        public Path f766;

        /* renamed from: 㿎  reason: contains not printable characters */
        public Paint f767;

        /* renamed from: 䁗  reason: contains not printable characters */
        public Rect f768 = new Rect();

        public C0126() {
            this.f756.setAntiAlias(true);
            this.f756.setColor(-21965);
            this.f756.setStrokeWidth(2.0f);
            this.f756.setStyle(Paint.Style.STROKE);
            this.f765 = new Paint();
            this.f765.setAntiAlias(true);
            this.f765.setColor(-2067046);
            this.f765.setStrokeWidth(2.0f);
            this.f765.setStyle(Paint.Style.STROKE);
            this.f760 = new Paint();
            this.f760.setAntiAlias(true);
            this.f760.setColor(-13391360);
            this.f760.setStrokeWidth(2.0f);
            this.f760.setStyle(Paint.Style.STROKE);
            this.f767 = new Paint();
            this.f767.setAntiAlias(true);
            this.f767.setColor(-13391360);
            this.f767.setTextSize(MotionLayout.this.getContext().getResources().getDisplayMetrics().density * 12.0f);
            this.f764 = new float[8];
            this.f758 = new Paint();
            this.f758.setAntiAlias(true);
            this.f757 = new DashPathEffect(new float[]{4.0f, 8.0f}, 0.0f);
            this.f760.setPathEffect(this.f757);
            this.f753 = new float[100];
            this.f759 = new int[50];
            if (this.f754) {
                this.f756.setStrokeWidth(8.0f);
                this.f758.setStrokeWidth(8.0f);
                this.f765.setStrokeWidth(8.0f);
                this.f763 = 4;
            }
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public final void m427(Canvas canvas) {
            float[] fArr = this.f761;
            canvas.drawLine(fArr[0], fArr[1], fArr[fArr.length - 2], fArr[fArr.length - 1], this.f760);
        }

        /* JADX WARNING: Removed duplicated region for block: B:102:0x0238  */
        /* JADX WARNING: Removed duplicated region for block: B:103:0x0244  */
        /* JADX WARNING: Removed duplicated region for block: B:75:0x01b0  */
        /* JADX WARNING: Removed duplicated region for block: B:86:0x01e0  */
        /* JADX WARNING: Removed duplicated region for block: B:92:0x0207  */
        /* JADX WARNING: Removed duplicated region for block: B:97:0x021c  */
        /* JADX WARNING: Removed duplicated region for block: B:98:0x0226  */
        /* renamed from: K  reason: contains not printable characters */
        public void m433(Canvas canvas, HashMap<View, C2110> hashMap, int i, int i2) {
            int i3;
            Iterator<C2110> it2;
            AbstractC2113 r19;
            C2184 r9;
            Iterator<C2112> it3;
            AbstractC2187 r2;
            if (!(hashMap == null || hashMap.size() == 0)) {
                canvas.save();
                if (!MotionLayout.this.isInEditMode() && (i2 & 1) == 2) {
                    String str = MotionLayout.this.getContext().getResources().getResourceName(MotionLayout.this.f722) + CertificateUtil.DELIMITER + MotionLayout.this.getProgress();
                    canvas.drawText(str, 10.0f, (float) (MotionLayout.this.getHeight() - 30), this.f767);
                    canvas.drawText(str, 11.0f, (float) (MotionLayout.this.getHeight() - 29), this.f756);
                }
                Iterator<C2110> it4 = hashMap.values().iterator();
                while (it4.hasNext()) {
                    C2110 next = it4.next();
                    int i4 = next.f7356.f7361;
                    Iterator<C2112> it5 = next.f7358.iterator();
                    while (it5.hasNext()) {
                        i4 = Math.max(i4, it5.next().f7361);
                    }
                    int max = Math.max(i4, next.f7338.f7361);
                    if (i2 > 0 && max == 0) {
                        max = 1;
                    }
                    if (max != 0) {
                        float[] fArr = this.f753;
                        int[] iArr = this.f759;
                        if (fArr != null) {
                            double[] r10 = next.f7357[0].m5742();
                            if (iArr != null) {
                                Iterator<C2112> it6 = next.f7358.iterator();
                                int i5 = 0;
                                while (it6.hasNext()) {
                                    iArr[i5] = it6.next().f7374;
                                    i5++;
                                }
                            }
                            int i6 = 0;
                            for (double d : r10) {
                                next.f7357[0].m5740(d, next.f7334);
                                next.f7356.m5599(next.f7359, next.f7334, fArr, i6);
                                i6 += 2;
                            }
                            i3 = i6 / 2;
                        } else {
                            i3 = 0;
                        }
                        this.f762 = i3;
                        if (max >= 1) {
                            int i7 = i / 16;
                            float[] fArr2 = this.f761;
                            if (fArr2 == null || fArr2.length != i7 * 2) {
                                this.f761 = new float[(i7 * 2)];
                                this.f766 = new Path();
                            }
                            float f = (float) this.f763;
                            canvas.translate(f, f);
                            this.f756.setColor(1996488704);
                            this.f758.setColor(1996488704);
                            this.f765.setColor(1996488704);
                            this.f760.setColor(1996488704);
                            float[] fArr3 = this.f761;
                            float f2 = 1.0f;
                            float f3 = 1.0f / ((float) (i7 - 1));
                            HashMap<String, AbstractC2113> hashMap2 = next.f7353;
                            AbstractC2113 r12 = hashMap2 == null ? null : hashMap2.get("translationX");
                            HashMap<String, AbstractC2113> hashMap3 = next.f7353;
                            AbstractC2113 r15 = hashMap3 == null ? null : hashMap3.get("translationY");
                            HashMap<String, AbstractC2140> hashMap4 = next.f7339;
                            AbstractC2140 r6 = hashMap4 == null ? null : hashMap4.get("translationX");
                            HashMap<String, AbstractC2140> hashMap5 = next.f7339;
                            AbstractC2140 r3 = hashMap5 == null ? null : hashMap5.get("translationY");
                            int i8 = 0;
                            while (true) {
                                float f4 = Float.NaN;
                                float f5 = 0.0f;
                                if (i8 >= i7) {
                                    break;
                                }
                                float f6 = ((float) i8) * f3;
                                if (next.f7349 != f2) {
                                    if (f6 < next.f7342) {
                                        f6 = 0.0f;
                                    }
                                    float f7 = next.f7342;
                                    if (f6 > f7) {
                                        r19 = r12;
                                        if (((double) f6) < 1.0d) {
                                            f6 = (f6 - f7) * next.f7349;
                                        }
                                        double d2 = (double) f6;
                                        r9 = next.f7356.f7366;
                                        for (it3 = next.f7358.iterator(); it3.hasNext(); it3 = it3) {
                                            C2112 next2 = it3.next();
                                            C2184 r7 = next2.f7366;
                                            if (r7 != null) {
                                                float f8 = next2.f7372;
                                                if (f8 < f6) {
                                                    f5 = f8;
                                                    r9 = r7;
                                                } else if (Float.isNaN(f4)) {
                                                    f4 = next2.f7372;
                                                }
                                            }
                                            i7 = i7;
                                        }
                                        if (r9 != null) {
                                            if (Float.isNaN(f4)) {
                                                f4 = 1.0f;
                                            }
                                            float f9 = f4 - f5;
                                            d2 = (double) ((((float) r9.m5723((double) ((f6 - f5) / f9))) * f9) + f5);
                                        }
                                        next.f7357[0].m5740(d2, next.f7334);
                                        r2 = next.f7343;
                                        if (r2 != null) {
                                            double[] dArr = next.f7334;
                                            if (dArr.length > 0) {
                                                r2.m5740(d2, dArr);
                                            }
                                        }
                                        int i9 = i8 * 2;
                                        next.f7356.m5599(next.f7359, next.f7334, fArr3, i9);
                                        if (r6 == null) {
                                            fArr3[i9] = r6.m5660(f6) + fArr3[i9];
                                        } else if (r19 != null) {
                                            r12 = r19;
                                            fArr3[i9] = r12.m5601(f6) + fArr3[i9];
                                            if (r3 != null) {
                                                int i10 = i9 + 1;
                                                fArr3[i10] = r3.m5660(f6) + fArr3[i10];
                                            } else if (r15 != null) {
                                                int i11 = i9 + 1;
                                                fArr3[i11] = r15.m5601(f6) + fArr3[i11];
                                            }
                                            i8++;
                                            it4 = it4;
                                            i7 = i7;
                                            f2 = 1.0f;
                                        }
                                        r12 = r19;
                                        if (r3 != null) {
                                        }
                                        i8++;
                                        it4 = it4;
                                        i7 = i7;
                                        f2 = 1.0f;
                                    }
                                }
                                r19 = r12;
                                double d22 = (double) f6;
                                r9 = next.f7356.f7366;
                                while (it3.hasNext()) {
                                }
                                if (r9 != null) {
                                }
                                next.f7357[0].m5740(d22, next.f7334);
                                r2 = next.f7343;
                                if (r2 != null) {
                                }
                                int i92 = i8 * 2;
                                next.f7356.m5599(next.f7359, next.f7334, fArr3, i92);
                                if (r6 == null) {
                                }
                                r12 = r19;
                                if (r3 != null) {
                                }
                                i8++;
                                it4 = it4;
                                i7 = i7;
                                f2 = 1.0f;
                            }
                            it2 = it4;
                            m432(canvas, max, this.f762, next);
                            this.f756.setColor(-21965);
                            this.f765.setColor(-2067046);
                            this.f758.setColor(-2067046);
                            this.f760.setColor(-13391360);
                            float f10 = (float) (-this.f763);
                            canvas.translate(f10, f10);
                            m432(canvas, max, this.f762, next);
                            if (max == 5) {
                                this.f766.reset();
                                int i12 = 0;
                                while (i12 <= 50) {
                                    float[] fArr4 = this.f764;
                                    next.f7357[0].m5740((double) next.m5590(((float) i12) / ((float) 50), null), next.f7334);
                                    C2112 r62 = next.f7356;
                                    int[] iArr2 = next.f7359;
                                    double[] dArr2 = next.f7334;
                                    float f11 = r62.f7371;
                                    float f12 = r62.f7367;
                                    float f13 = r62.f7373;
                                    float f14 = f12;
                                    float f15 = r62.f7365;
                                    int i13 = 0;
                                    while (i13 < iArr2.length) {
                                        float f16 = (float) dArr2[i13];
                                        int i14 = iArr2[i13];
                                        if (i14 != 0) {
                                            if (i14 == 1) {
                                                f11 = f16;
                                            } else if (i14 == 2) {
                                                f14 = f16;
                                            } else if (i14 == 3) {
                                                f13 = f16;
                                            } else if (i14 == 4) {
                                                f15 = f16;
                                            }
                                        }
                                        i13++;
                                        i12 = i12;
                                    }
                                    float f17 = f13 + f11;
                                    float f18 = f15 + f14;
                                    Float.isNaN(Float.NaN);
                                    Float.isNaN(Float.NaN);
                                    float f19 = f11 + 0.0f;
                                    float f20 = f14 + 0.0f;
                                    float f21 = f17 + 0.0f;
                                    float f22 = f18 + 0.0f;
                                    fArr4[0] = f19;
                                    fArr4[1] = f20;
                                    fArr4[2] = f21;
                                    fArr4[3] = f20;
                                    fArr4[4] = f21;
                                    fArr4[5] = f22;
                                    fArr4[6] = f19;
                                    fArr4[7] = f22;
                                    Path path = this.f766;
                                    float[] fArr5 = this.f764;
                                    path.moveTo(fArr5[0], fArr5[1]);
                                    Path path2 = this.f766;
                                    float[] fArr6 = this.f764;
                                    path2.lineTo(fArr6[2], fArr6[3]);
                                    Path path3 = this.f766;
                                    float[] fArr7 = this.f764;
                                    path3.lineTo(fArr7[4], fArr7[5]);
                                    Path path4 = this.f766;
                                    float[] fArr8 = this.f764;
                                    path4.lineTo(fArr8[6], fArr8[7]);
                                    this.f766.close();
                                    i12++;
                                }
                                this.f756.setColor(1140850688);
                                canvas.translate(2.0f, 2.0f);
                                canvas.drawPath(this.f766, this.f756);
                                canvas.translate(-2.0f, -2.0f);
                                this.f756.setColor(-65536);
                                canvas.drawPath(this.f766, this.f756);
                                it4 = it2;
                            }
                        } else {
                            it2 = it4;
                        }
                        it4 = it2;
                    }
                }
                canvas.restore();
            }
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public final void m428(Canvas canvas, float f, float f2) {
            float[] fArr = this.f761;
            float f3 = fArr[0];
            float f4 = fArr[1];
            float f5 = fArr[fArr.length - 2];
            float f6 = fArr[fArr.length - 1];
            float hypot = (float) Math.hypot((double) (f3 - f5), (double) (f4 - f6));
            float f7 = f5 - f3;
            float f8 = f6 - f4;
            float f9 = (((f2 - f4) * f8) + ((f - f3) * f7)) / (hypot * hypot);
            float f10 = f3 + (f7 * f9);
            float f11 = f4 + (f9 * f8);
            Path path = new Path();
            path.moveTo(f, f2);
            path.lineTo(f10, f11);
            float hypot2 = (float) Math.hypot((double) (f10 - f), (double) (f11 - f2));
            StringBuilder r7 = C1293.m3416("");
            r7.append(((float) ((int) ((hypot2 * 100.0f) / hypot))) / 100.0f);
            String sb = r7.toString();
            m434(sb, this.f767);
            canvas.drawTextOnPath(sb, path, (hypot2 / 2.0f) - ((float) (this.f768.width() / 2)), -20.0f, this.f767);
            canvas.drawLine(f, f2, f10, f11, this.f760);
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m432(Canvas canvas, int i, int i2, C2110 r25) {
            int i3;
            int i4;
            int i5;
            float f;
            float f2;
            if (i == 4) {
                boolean z = false;
                boolean z2 = false;
                for (int i6 = 0; i6 < this.f762; i6++) {
                    if (this.f759[i6] == 1) {
                        z = true;
                    }
                    if (this.f759[i6] == 2) {
                        z2 = true;
                    }
                }
                if (z) {
                    m427(canvas);
                }
                if (z2) {
                    m429(canvas);
                }
            }
            if (i == 2) {
                m427(canvas);
            }
            if (i == 3) {
                m429(canvas);
            }
            canvas.drawLines(this.f761, this.f756);
            View view = r25.f7346;
            if (view != null) {
                i4 = view.getWidth();
                i3 = r25.f7346.getHeight();
            } else {
                i4 = 0;
                i3 = 0;
            }
            int i7 = 1;
            while (i7 < i2 - 1) {
                if (i == 4 && this.f759[i7 - 1] == 0) {
                    i5 = i7;
                } else {
                    float[] fArr = this.f753;
                    int i8 = i7 * 2;
                    float f3 = fArr[i8];
                    float f4 = fArr[i8 + 1];
                    this.f766.reset();
                    this.f766.moveTo(f3, f4 + 10.0f);
                    this.f766.lineTo(f3 + 10.0f, f4);
                    this.f766.lineTo(f3, f4 - 10.0f);
                    this.f766.lineTo(f3 - 10.0f, f4);
                    this.f766.close();
                    int i9 = i7 - 1;
                    r25.f7358.get(i9);
                    if (i == 4) {
                        int[] iArr = this.f759;
                        if (iArr[i9] == 1) {
                            m428(canvas, f3 - 0.0f, f4 - 0.0f);
                        } else if (iArr[i9] == 2) {
                            m430(canvas, f3 - 0.0f, f4 - 0.0f);
                        } else if (iArr[i9] == 3) {
                            f = f4;
                            f2 = f3;
                            i5 = i7;
                            m431(canvas, f3 - 0.0f, f4 - 0.0f, i4, i3);
                            canvas.drawPath(this.f766, this.f758);
                        }
                        f = f4;
                        f2 = f3;
                        i5 = i7;
                        canvas.drawPath(this.f766, this.f758);
                    } else {
                        f = f4;
                        f2 = f3;
                        i5 = i7;
                    }
                    if (i == 2) {
                        m428(canvas, f2 - 0.0f, f - 0.0f);
                    }
                    if (i == 3) {
                        m430(canvas, f2 - 0.0f, f - 0.0f);
                    }
                    if (i == 6) {
                        m431(canvas, f2 - 0.0f, f - 0.0f, i4, i3);
                    }
                    canvas.drawPath(this.f766, this.f758);
                }
                i7 = i5 + 1;
            }
            float[] fArr2 = this.f761;
            if (fArr2.length > 1) {
                canvas.drawCircle(fArr2[0], fArr2[1], 8.0f, this.f765);
                float[] fArr3 = this.f761;
                canvas.drawCircle(fArr3[fArr3.length - 2], fArr3[fArr3.length - 1], 8.0f, this.f765);
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m434(String str, Paint paint) {
            paint.getTextBounds(str, 0, str.length(), this.f768);
        }

        /* renamed from: K  reason: contains not printable characters */
        public final void m429(Canvas canvas) {
            float[] fArr = this.f761;
            float f = fArr[0];
            float f2 = fArr[1];
            float f3 = fArr[fArr.length - 2];
            float f4 = fArr[fArr.length - 1];
            canvas.drawLine(Math.min(f, f3), Math.max(f2, f4), Math.max(f, f3), Math.max(f2, f4), this.f760);
            canvas.drawLine(Math.min(f, f3), Math.min(f2, f4), Math.min(f, f3), Math.max(f2, f4), this.f760);
        }

        /* renamed from: K  reason: contains not printable characters */
        public final void m430(Canvas canvas, float f, float f2) {
            float[] fArr = this.f761;
            float f3 = fArr[0];
            float f4 = fArr[1];
            float f5 = fArr[fArr.length - 2];
            float f6 = fArr[fArr.length - 1];
            float min = Math.min(f3, f5);
            float max = Math.max(f4, f6);
            float min2 = f - Math.min(f3, f5);
            float max2 = Math.max(f4, f6) - f2;
            StringBuilder r5 = C1293.m3416("");
            r5.append(((float) ((int) (((double) ((min2 * 100.0f) / Math.abs(f5 - f3))) + 0.5d))) / 100.0f);
            String sb = r5.toString();
            m434(sb, this.f767);
            canvas.drawText(sb, ((min2 / 2.0f) - ((float) (this.f768.width() / 2))) + min, f2 - 20.0f, this.f767);
            canvas.drawLine(f, f2, Math.min(f3, f5), f2, this.f760);
            StringBuilder r1 = C1293.m3416("");
            r1.append(((float) ((int) (((double) ((max2 * 100.0f) / Math.abs(f6 - f4))) + 0.5d))) / 100.0f);
            String sb2 = r1.toString();
            m434(sb2, this.f767);
            canvas.drawText(sb2, f + 5.0f, max - ((max2 / 2.0f) - ((float) (this.f768.height() / 2))), this.f767);
            canvas.drawLine(f, f2, f, Math.max(f4, f6), this.f760);
        }

        /* renamed from: K  reason: contains not printable characters */
        public final void m431(Canvas canvas, float f, float f2, int i, int i2) {
            StringBuilder r1 = C1293.m3416("");
            r1.append(((float) ((int) (((double) (((f - ((float) (i / 2))) * 100.0f) / ((float) (MotionLayout.this.getWidth() - i)))) + 0.5d))) / 100.0f);
            String sb = r1.toString();
            m434(sb, this.f767);
            canvas.drawText(sb, ((f / 2.0f) - ((float) (this.f768.width() / 2))) + 0.0f, f2 - 20.0f, this.f767);
            canvas.drawLine(f, f2, Math.min(0.0f, 1.0f), f2, this.f760);
            StringBuilder r12 = C1293.m3416("");
            r12.append(((float) ((int) (((double) (((f2 - ((float) (i2 / 2))) * 100.0f) / ((float) (MotionLayout.this.getHeight() - i2)))) + 0.5d))) / 100.0f);
            String sb2 = r12.toString();
            m434(sb2, this.f767);
            canvas.drawText(sb2, f + 5.0f, 0.0f - ((f2 / 2.0f) - ((float) (this.f768.height() / 2))), this.f767);
            canvas.drawLine(f, f2, f, Math.max(0.0f, 1.0f), this.f760);
        }
    }

    /* renamed from: androidx.constraintlayout.motion.widget.MotionLayout$ඓ  reason: contains not printable characters */
    public interface AbstractC0127 {
    }

    /* renamed from: androidx.constraintlayout.motion.widget.MotionLayout$ῲ  reason: contains not printable characters */
    public class C0128 extends Abstractanimation.InterpolatorC2160 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public float f769;

        /* renamed from: ῲ  reason: contains not printable characters */
        public float f770 = 0.0f;

        /* renamed from: K  reason: contains not printable characters */
        public float f771 = 0.0f;

        public C0128() {
        }

        public float getInterpolation(float f) {
            float f2 = this.f771;
            if (f2 > 0.0f) {
                float f3 = this.f769;
                if (f2 / f3 < f) {
                    f = f2 / f3;
                }
                MotionLayout motionLayout = MotionLayout.this;
                float f4 = this.f771;
                float f5 = this.f769;
                motionLayout.f746 = f4 - (f5 * f);
                return ((f4 * f) - (((f5 * f) * f) / 2.0f)) + this.f770;
            }
            float f6 = this.f769;
            if ((-f2) / f6 < f) {
                f = (-f2) / f6;
            }
            MotionLayout motionLayout2 = MotionLayout.this;
            float f7 = this.f771;
            float f8 = this.f769;
            motionLayout2.f746 = (f8 * f) + f7;
            return (((f8 * f) * f) / 2.0f) + (f7 * f) + this.f770;
        }

        @Override // ῲ.ⁱ.K.ῲ.Abstractanimation.InterpolatorC2160
        /* renamed from: K  reason: contains not printable characters */
        public float m435() {
            return MotionLayout.this.f746;
        }
    }

    /* renamed from: androidx.constraintlayout.motion.widget.MotionLayout$K  reason: contains not printable characters */
    public class RunnableC0130 implements Runnable {

        /* renamed from: ῲ  reason: contains not printable characters */
        public final /* synthetic */ View f778;

        public RunnableC0130(MotionLayout motionLayout, View view) {
            this.f778 = view;
        }

        public void run() {
            this.f778.setNestedScrollingEnabled(true);
        }
    }

    /* renamed from: androidx.constraintlayout.motion.widget.MotionLayout$㴹  reason: contains not printable characters */
    public static class C0131 implements AbstractC0127 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public static C0131 f779 = new C0131();

        /* renamed from: K  reason: contains not printable characters */
        public VelocityTracker f780;
    }

    /* renamed from: androidx.constraintlayout.motion.widget.MotionLayout$㿎  reason: contains not printable characters */
    public interface AbstractC0133 {
        /* renamed from: K  reason: contains not printable characters */
        void m445(MotionLayout motionLayout, int i);

        /* renamed from: K  reason: contains not printable characters */
        void m446(MotionLayout motionLayout, int i, int i2);

        /* renamed from: K  reason: contains not printable characters */
        void m447(MotionLayout motionLayout, int i, int i2, float f);

        /* renamed from: K  reason: contains not printable characters */
        void m448(MotionLayout motionLayout, int i, boolean z, float f);
    }

    public MotionLayout(Context context) {
        super(context);
        m420((AttributeSet) null);
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void dispatchDraw(Canvas canvas) {
        String str;
        m422(false);
        super.dispatchDraw(canvas);
        if (this.f721 != null) {
            if ((this.f713 & 1) == 1 && !isInEditMode()) {
                this.f730++;
                long nanoTime = getNanoTime();
                long j = this.f745;
                if (j != -1) {
                    long j2 = nanoTime - j;
                    if (j2 > 200000000) {
                        this.f695 = ((float) ((int) ((((float) this.f730) / (((float) j2) * 1.0E-9f)) * 100.0f))) / 100.0f;
                        this.f730 = 0;
                        this.f745 = nanoTime;
                    }
                } else {
                    this.f745 = nanoTime;
                }
                Paint paint = new Paint();
                paint.setTextSize(42.0f);
                StringBuilder r4 = C1293.m3416(this.f695 + " fps " + C2369.m6317(this, this.f705) + " -> ");
                r4.append(C2369.m6317(this, this.f722));
                r4.append(" (progress: ");
                r4.append(((float) ((int) (getProgress() * 1000.0f))) / 10.0f);
                r4.append(" ) state=");
                int i = this.f742;
                if (i == -1) {
                    str = "undefined";
                } else {
                    str = C2369.m6317(this, i);
                }
                r4.append(str);
                String sb = r4.toString();
                paint.setColor(-16777216);
                canvas.drawText(sb, 11.0f, (float) (getHeight() - 29), paint);
                paint.setColor(-7864184);
                canvas.drawText(sb, 10.0f, (float) (getHeight() - 30), paint);
            }
            if (this.f713 > 1) {
                if (this.f741 == null) {
                    this.f741 = new C0126();
                }
                this.f741.m433(canvas, this.f716, this.f721.m5629(), this.f713);
            }
        }
    }

    public int[] getConstraintSetIds() {
        C2131 r0 = this.f721;
        if (r0 == null) {
            return null;
        }
        int[] iArr = new int[r0.f7424.size()];
        for (int i = 0; i < iArr.length; i++) {
            iArr[i] = r0.f7424.keyAt(i);
        }
        return iArr;
    }

    public int getCurrentState() {
        return this.f742;
    }

    public ArrayList<C2131.C2132> getDefinedTransitions() {
        C2131 r0 = this.f721;
        if (r0 == null) {
            return null;
        }
        return r0.f7411;
    }

    public C2139 getDesignTool() {
        if (this.f737 == null) {
            this.f737 = new C2139(this);
        }
        return this.f737;
    }

    public int getEndState() {
        return this.f722;
    }

    public long getNanoTime() {
        return System.nanoTime();
    }

    public float getProgress() {
        return this.f732;
    }

    public int getStartState() {
        return this.f705;
    }

    public float getTargetPosition() {
        return this.f714;
    }

    public Bundle getTransitionState() {
        if (this.f733 == null) {
            this.f733 = new C0129();
        }
        C0129 r0 = this.f733;
        r0.f777 = MotionLayout.this.f722;
        MotionLayout motionLayout = MotionLayout.this;
        r0.f773 = motionLayout.f705;
        r0.f775 = motionLayout.getVelocity();
        r0.f776 = MotionLayout.this.getProgress();
        return this.f733.m436();
    }

    public long getTransitionTimeMs() {
        C2131 r0 = this.f721;
        if (r0 != null) {
            this.f750 = ((float) r0.m5629()) / 1000.0f;
        }
        return (long) (this.f750 * 1000.0f);
    }

    public float getVelocity() {
        return this.f746;
    }

    public boolean isAttachedToWindow() {
        int i = Build.VERSION.SDK_INT;
        return super.isAttachedToWindow();
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void loadLayoutDescription(int i) {
        if (i != 0) {
            try {
                this.f721 = new C2131(getContext(), this, i);
                int i2 = Build.VERSION.SDK_INT;
                if (isAttachedToWindow()) {
                    this.f721.m5639(this);
                    this.f701.m442(this.f721.m5635(this.f705), this.f721.m5635(this.f722));
                    m410();
                    this.f721.m5641(isRtl());
                }
            } catch (Exception e) {
                throw new IllegalArgumentException("unable to parse MotionScene file", e);
            }
        } else {
            this.f721 = null;
        }
    }

    public void onAttachedToWindow() {
        int i;
        super.onAttachedToWindow();
        C2131 r0 = this.f721;
        if (!(r0 == null || (i = this.f742) == -1)) {
            C2059 r02 = r0.m5635(i);
            this.f721.m5639(this);
            if (r02 != null) {
                r02.m5374((ConstraintLayout) this, true);
                setConstraintSet(null);
                requestLayout();
            }
            this.f705 = this.f742;
        }
        m406();
        C0129 r03 = this.f733;
        if (r03 != null) {
            r03.m437();
        } else if (this.f721.f7407.f7428 == 4) {
            m426();
            setState(TransitionState.SETUP);
            setState(TransitionState.MOVING);
        }
    }

    public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        C2131.C2132 r0;
        C2130 r02;
        int i;
        RectF r2;
        C2131 r03 = this.f721;
        if (r03 != null && this.f740 && (r0 = r03.f7407) != null && (!r0.f7438) && (r02 = r0.f7437) != null && ((motionEvent.getAction() != 0 || (r2 = r02.m5623(this, new RectF())) == null || r2.contains(motionEvent.getX(), motionEvent.getY())) && (i = r02.f7391) != -1)) {
            View view = this.f703;
            if (view == null || view.getId() != i) {
                this.f703 = findViewById(i);
            }
            View view2 = this.f703;
            if (view2 != null) {
                this.f736.set((float) view2.getLeft(), (float) this.f703.getTop(), (float) this.f703.getRight(), (float) this.f703.getBottom());
                if (this.f736.contains(motionEvent.getX(), motionEvent.getY()) && !m423(0.0f, 0.0f, this.f703, motionEvent)) {
                    return onTouchEvent(motionEvent);
                }
            }
        }
        return false;
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void onLayout(boolean z, int i, int i2, int i3, int i4) {
        this.f715 = true;
        try {
            if (this.f721 == null) {
                super.onLayout(z, i, i2, i3, i4);
                return;
            }
            int i5 = i3 - i;
            int i6 = i4 - i2;
            if (!(this.f751 == i5 && this.f717 == i6)) {
                m410();
                m422(true);
            }
            this.f751 = i5;
            this.f717 = i6;
            this.f715 = false;
        } finally {
            this.f715 = false;
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:24:0x0048, code lost:
        if (((r3 == r0.f782 && r4 == r0.f786) ? false : true) != false) goto L_0x004a;
     */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x00df  */
    /* JADX WARNING: Removed duplicated region for block: B:44:0x00ec  */
    /* JADX WARNING: Removed duplicated region for block: B:47:0x00f4  */
    /* JADX WARNING: Removed duplicated region for block: B:63:0x0118  */
    /* JADX WARNING: Removed duplicated region for block: B:64:0x0123  */
    /* JADX WARNING: Removed duplicated region for block: B:75:0x0147  */
    /* JADX WARNING: Removed duplicated region for block: B:81:0x0164  */
    /* JADX WARNING: Removed duplicated region for block: B:86:? A[RETURN, SYNTHETIC] */
    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void onMeasure(int i, int i2) {
        boolean z;
        float f;
        int i3;
        int childCount;
        if (this.f721 == null) {
            super.onMeasure(i, i2);
            return;
        }
        boolean z2 = true;
        boolean z3 = (this.f748 == i && this.f718 == i2) ? false : true;
        if (this.f726) {
            this.f726 = false;
            m406();
            m424();
            z3 = true;
        }
        if (this.mDirtyHierarchy) {
            z3 = true;
        }
        this.f748 = i;
        this.f718 = i2;
        int r3 = this.f721.m5632();
        int r4 = this.f721.m5627();
        if (!z3) {
            C0132 r0 = this.f701;
        }
        if (this.f705 != -1) {
            super.onMeasure(i, i2);
            this.f701.m442(this.f721.m5635(r3), this.f721.m5635(r4));
            this.f701.m439();
            C0132 r14 = this.f701;
            r14.f782 = r3;
            r14.f786 = r4;
            z = false;
            if (this.f706 || z) {
                int paddingBottom = getPaddingBottom() + getPaddingTop();
                int r142 = this.mLayoutWidget.m478() + getPaddingRight() + getPaddingLeft();
                int r02 = this.mLayoutWidget.m473() + paddingBottom;
                int i4 = this.f710;
                if (i4 == Integer.MIN_VALUE || i4 == 0) {
                    int i5 = this.f739;
                    r142 = (int) ((this.f696 * ((float) (this.f731 - i5))) + ((float) i5));
                    requestLayout();
                }
                int i6 = this.f719;
                if (i6 == Integer.MIN_VALUE || i6 == 0) {
                    int i7 = this.f728;
                    r02 = (int) ((this.f696 * ((float) (this.f693 - i7))) + ((float) i7));
                    requestLayout();
                }
                setMeasuredDimension(r142, r02);
            }
            float signum = Math.signum(this.f714 - this.f732);
            long nanoTime = getNanoTime();
            f = this.f732 + (this.f692 instanceof C2189 ? ((((float) (nanoTime - this.f699)) * signum) * 1.0E-9f) / this.f750 : 0.0f);
            if (this.f734) {
                f = this.f714;
            }
            i3 = (signum > 0.0f ? 1 : (signum == 0.0f ? 0 : -1));
            if ((i3 > 0 || f < this.f714) && (signum > 0.0f || f > this.f714)) {
                z2 = false;
            } else {
                f = this.f714;
            }
            Interpolator interpolator = this.f692;
            if (interpolator != null && !z2) {
                if (!this.f711) {
                    f = interpolator.getInterpolation(((float) (nanoTime - this.f729)) * 1.0E-9f);
                } else {
                    f = interpolator.getInterpolation(f);
                }
            }
            if ((i3 > 0 && f >= this.f714) || (signum <= 0.0f && f <= this.f714)) {
                f = this.f714;
            }
            this.f696 = f;
            childCount = getChildCount();
            long nanoTime2 = getNanoTime();
            for (int i8 = 0; i8 < childCount; i8++) {
                View childAt = getChildAt(i8);
                C2110 r7 = this.f716.get(childAt);
                if (r7 != null) {
                    r7.m5594(childAt, f, nanoTime2, this.f743);
                }
            }
            if (!this.f706) {
                requestLayout();
                return;
            }
            return;
        }
        z = true;
        int paddingBottom2 = getPaddingBottom() + getPaddingTop();
        int r1422 = this.mLayoutWidget.m478() + getPaddingRight() + getPaddingLeft();
        int r022 = this.mLayoutWidget.m473() + paddingBottom2;
        int i42 = this.f710;
        int i52 = this.f739;
        r1422 = (int) ((this.f696 * ((float) (this.f731 - i52))) + ((float) i52));
        requestLayout();
        int i62 = this.f719;
        int i72 = this.f728;
        r022 = (int) ((this.f696 * ((float) (this.f693 - i72))) + ((float) i72));
        requestLayout();
        setMeasuredDimension(r1422, r022);
        float signum2 = Math.signum(this.f714 - this.f732);
        long nanoTime3 = getNanoTime();
        f = this.f732 + (this.f692 instanceof C2189 ? ((((float) (nanoTime3 - this.f699)) * signum2) * 1.0E-9f) / this.f750 : 0.0f);
        if (this.f734) {
        }
        i3 = (signum2 > 0.0f ? 1 : (signum2 == 0.0f ? 0 : -1));
        if (i3 > 0) {
        }
        z2 = false;
        Interpolator interpolator2 = this.f692;
        if (!this.f711) {
        }
        f = this.f714;
        this.f696 = f;
        childCount = getChildCount();
        long nanoTime22 = getNanoTime();
        while (i8 < childCount) {
        }
        if (!this.f706) {
        }
    }

    public boolean onNestedFling(View view, float f, float f2, boolean z) {
        return false;
    }

    public boolean onNestedPreFling(View view, float f, float f2) {
        return false;
    }

    @Override // ῲ.ᨨ.ᨨ.AbstractC1742
    public void onNestedPreScroll(View view, int i, int i2, int[] iArr, int i3) {
        C2131.C2132 r4;
        boolean z;
        C2130 r42;
        float f;
        float f2;
        C2130 r5;
        C2130 r52;
        int i4;
        C2131 r43 = this.f721;
        if (r43 != null && (r4 = r43.f7407) != null && (!r4.f7438)) {
            if (!z || (r52 = r4.f7437) == null || (i4 = r52.f7391) == -1 || view.getId() == i4) {
                C2131 r53 = this.f721;
                if (r53 != null) {
                    C2131.C2132 r54 = r53.f7407;
                    if ((r54 == null || (r5 = r54.f7437) == null) ? false : r5.f7400) {
                        float f3 = this.f697;
                        if ((f3 == 1.0f || f3 == 0.0f) && view.canScrollVertically(-1)) {
                            return;
                        }
                    }
                }
                if (r4.f7437 != null) {
                    C2131.C2132 r44 = this.f721.f7407;
                    C2130 r55 = r44.f7437;
                    if ((r55.f7405 & 1) != 0) {
                        float f4 = (float) i;
                        float f5 = (float) i2;
                        if (r44 == null || r55 == null) {
                            f2 = 0.0f;
                        } else {
                            r55.f7399.m416(r55.f7403, r55.f7399.getProgress(), r55.f7404, r55.f7396, r55.f7398);
                            if (r55.f7394 != 0.0f) {
                                float[] fArr = r55.f7398;
                                if (fArr[0] == 0.0f) {
                                    fArr[0] = 1.0E-7f;
                                }
                                f2 = (f4 * r55.f7394) / r55.f7398[0];
                            } else {
                                float[] fArr2 = r55.f7398;
                                if (fArr2[1] == 0.0f) {
                                    fArr2[1] = 1.0E-7f;
                                }
                                f2 = (f5 * r55.f7401) / r55.f7398[1];
                            }
                        }
                        if ((this.f732 <= 0.0f && f2 < 0.0f) || (this.f732 >= 1.0f && f2 > 0.0f)) {
                            int i5 = Build.VERSION.SDK_INT;
                            view.setNestedScrollingEnabled(false);
                            view.post(new RunnableC0130(this, view));
                            return;
                        }
                    }
                }
                float f6 = this.f697;
                long nanoTime = getNanoTime();
                float f7 = (float) i;
                this.f724 = f7;
                float f8 = (float) i2;
                this.f708 = f8;
                this.f694 = (float) (((double) (nanoTime - this.f712)) * 1.0E-9d);
                this.f712 = nanoTime;
                C2131.C2132 r45 = this.f721.f7407;
                if (!(r45 == null || (r42 = r45.f7437) == null)) {
                    float progress = r42.f7399.getProgress();
                    if (!r42.f7393) {
                        r42.f7393 = true;
                        r42.f7399.setProgress(progress);
                    }
                    r42.f7399.m416(r42.f7403, progress, r42.f7404, r42.f7396, r42.f7398);
                    float f9 = r42.f7394;
                    float[] fArr3 = r42.f7398;
                    if (((double) Math.abs((r42.f7401 * fArr3[1]) + (f9 * fArr3[0]))) < 0.01d) {
                        float[] fArr4 = r42.f7398;
                        fArr4[0] = 0.01f;
                        fArr4[1] = 0.01f;
                    }
                    float f10 = r42.f7394;
                    if (f10 != 0.0f) {
                        f = (f7 * f10) / r42.f7398[0];
                    } else {
                        f = (f8 * r42.f7401) / r42.f7398[1];
                    }
                    float max = Math.max(Math.min(progress + f, 1.0f), 0.0f);
                    if (max != r42.f7399.getProgress()) {
                        r42.f7399.setProgress(max);
                    }
                }
                if (f6 != this.f697) {
                    iArr[0] = i;
                    iArr[1] = i2;
                }
                m422(false);
                if (iArr[0] != 0 || iArr[1] != 0) {
                    this.f707 = true;
                }
            }
        }
    }

    @Override // ῲ.ᨨ.ᨨ.AbstractC1742
    public void onNestedScroll(View view, int i, int i2, int i3, int i4, int i5) {
    }

    @Override // ῲ.ᨨ.ᨨ.AbstractC1767
    public void onNestedScroll(View view, int i, int i2, int i3, int i4, int i5, int[] iArr) {
        if (!(!this.f707 && i == 0 && i2 == 0)) {
            iArr[0] = iArr[0] + i3;
            iArr[1] = iArr[1] + i4;
        }
        this.f707 = false;
    }

    @Override // ῲ.ᨨ.ᨨ.AbstractC1742
    public void onNestedScrollAccepted(View view, View view2, int i, int i2) {
    }

    public void onRtlPropertiesChanged(int i) {
        C2131 r2 = this.f721;
        if (r2 != null) {
            r2.m5641(isRtl());
        }
    }

    @Override // ῲ.ᨨ.ᨨ.AbstractC1742
    public boolean onStartNestedScroll(View view, View view2, int i, int i2) {
        C2131.C2132 r1;
        C2130 r12;
        C2131 r13 = this.f721;
        return (r13 == null || (r1 = r13.f7407) == null || (r12 = r1.f7437) == null || (r12.f7405 & 2) != 0) ? false : true;
    }

    @Override // ῲ.ᨨ.ᨨ.AbstractC1742
    public void onStopNestedScroll(View view, int i) {
        C2130 r10;
        float f;
        C2131 r102 = this.f721;
        if (r102 != null) {
            float f2 = this.f724;
            float f3 = this.f694;
            float f4 = f2 / f3;
            float f5 = this.f708 / f3;
            C2131.C2132 r103 = r102.f7407;
            if (r103 != null && (r10 = r103.f7437) != null) {
                boolean z = false;
                r10.f7393 = false;
                float progress = r10.f7399.getProgress();
                r10.f7399.m416(r10.f7403, progress, r10.f7404, r10.f7396, r10.f7398);
                float f6 = r10.f7394;
                float[] fArr = r10.f7398;
                float f7 = fArr[0];
                float f8 = r10.f7401;
                float f9 = fArr[1];
                if (f6 != 0.0f) {
                    f = (f4 * f6) / fArr[0];
                } else {
                    f = (f5 * f8) / fArr[1];
                }
                if (!Float.isNaN(f)) {
                    progress += f / 3.0f;
                }
                if (progress != 0.0f) {
                    float f10 = 1.0f;
                    boolean z2 = progress != 1.0f;
                    if (r10.f7386 != 3) {
                        z = true;
                    }
                    if (z && z2) {
                        MotionLayout motionLayout = r10.f7399;
                        int i2 = r10.f7386;
                        if (((double) progress) < 0.5d) {
                            f10 = 0.0f;
                        }
                        motionLayout.m415(i2, f10, f);
                    }
                }
            }
        }
    }

    public boolean onTouchEvent(MotionEvent motionEvent) {
        C2131 r0 = this.f721;
        if (r0 == null || !this.f740 || !r0.m5645()) {
            return super.onTouchEvent(motionEvent);
        }
        C2131.C2132 r02 = this.f721.f7407;
        if (r02 != null && !(!r02.f7438)) {
            return super.onTouchEvent(motionEvent);
        }
        this.f721.m5638(motionEvent, getCurrentState(), this);
        return true;
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void onViewAdded(View view) {
        super.onViewAdded(view);
        if (view instanceof MotionHelper) {
            MotionHelper motionHelper = (MotionHelper) view;
            if (this.f747 == null) {
                this.f747 = new ArrayList<>();
            }
            this.f747.add(motionHelper);
            if (motionHelper.m394()) {
                if (this.f704 == null) {
                    this.f704 = new ArrayList<>();
                }
                this.f704.add(motionHelper);
            }
            if (motionHelper.m401()) {
                if (this.f709 == null) {
                    this.f709 = new ArrayList<>();
                }
                this.f709.add(motionHelper);
            }
        }
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void onViewRemoved(View view) {
        super.onViewRemoved(view);
        ArrayList<MotionHelper> arrayList = this.f704;
        if (arrayList != null) {
            arrayList.remove(view);
        }
        ArrayList<MotionHelper> arrayList2 = this.f709;
        if (arrayList2 != null) {
            arrayList2.remove(view);
        }
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void parseLayoutDescription(int i) {
        this.mConstraintLayoutSpec = null;
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void requestLayout() {
        C2131 r0;
        C2131.C2132 r02;
        if (this.f706 || this.f742 != -1 || (r0 = this.f721) == null || (r02 = r0.f7407) == null || r02.f7431 != 0) {
            super.requestLayout();
        }
    }

    public void setDebugMode(int i) {
        this.f713 = i;
        invalidate();
    }

    public void setInteractionEnabled(boolean z) {
        this.f740 = z;
    }

    public void setInterpolatedProgress(float f) {
        if (this.f721 != null) {
            setState(TransitionState.MOVING);
            Interpolator r0 = this.f721.m5644();
            if (r0 != null) {
                setProgress(r0.getInterpolation(f));
                return;
            }
        }
        setProgress(f);
    }

    public void setOnHide(float f) {
        ArrayList<MotionHelper> arrayList = this.f709;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                this.f709.get(i).setProgress(f);
            }
        }
    }

    public void setOnShow(float f) {
        ArrayList<MotionHelper> arrayList = this.f704;
        if (arrayList != null) {
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                this.f704.get(i).setProgress(f);
            }
        }
    }

    public void setProgress(float f) {
        int i = (f > 0.0f ? 1 : (f == 0.0f ? 0 : -1));
        if (i < 0 || f > 1.0f) {
            Log.w("MotionLayout", "Warning! Progress is defined for values between 0.0 and 1.0 inclusive");
        }
        if (!isAttachedToWindow()) {
            if (this.f733 == null) {
                this.f733 = new C0129();
            }
            this.f733.f776 = f;
            return;
        }
        if (i <= 0) {
            this.f742 = this.f705;
            if (this.f732 == 0.0f) {
                setState(TransitionState.FINISHED);
            }
        } else if (f >= 1.0f) {
            this.f742 = this.f722;
            if (this.f732 == 1.0f) {
                setState(TransitionState.FINISHED);
            }
        } else {
            this.f742 = -1;
            setState(TransitionState.MOVING);
        }
        if (this.f721 != null) {
            this.f734 = true;
            this.f714 = f;
            this.f697 = f;
            this.f699 = -1;
            this.f729 = -1;
            this.f692 = null;
            this.f700 = true;
            invalidate();
        }
    }

    public void setScene(C2131 r2) {
        this.f721 = r2;
        this.f721.m5641(isRtl());
        m410();
    }

    public void setState(TransitionState transitionState) {
        if (transitionState != TransitionState.FINISHED || this.f742 != -1) {
            TransitionState transitionState2 = this.f723;
            this.f723 = transitionState;
            TransitionState transitionState3 = TransitionState.MOVING;
            if (transitionState2 == transitionState3 && transitionState == transitionState3) {
                m412();
            }
            int ordinal = transitionState2.ordinal();
            if (ordinal == 0 || ordinal == 1) {
                if (transitionState == TransitionState.MOVING) {
                    m412();
                }
                if (transitionState == TransitionState.FINISHED) {
                    m408();
                }
            } else if (ordinal == 2 && transitionState == TransitionState.FINISHED) {
                m408();
            }
        }
    }

    public void setTransition(int i) {
        C2130 r6;
        if (this.f721 != null) {
            C2131.C2132 r62 = m411(i);
            this.f705 = r62.f7442;
            this.f722 = r62.f7427;
            if (!isAttachedToWindow()) {
                if (this.f733 == null) {
                    this.f733 = new C0129();
                }
                C0129 r63 = this.f733;
                r63.f773 = this.f705;
                r63.f777 = this.f722;
                return;
            }
            float f = Float.NaN;
            int i2 = this.f742;
            float f2 = 0.0f;
            if (i2 == this.f705) {
                f = 0.0f;
            } else if (i2 == this.f722) {
                f = 1.0f;
            }
            C2131 r1 = this.f721;
            r1.f7407 = r62;
            C2131.C2132 r64 = r1.f7407;
            if (!(r64 == null || (r6 = r64.f7437) == null)) {
                r6.m5625(r1.f7420);
            }
            this.f701.m442(this.f721.m5635(this.f705), this.f721.m5635(this.f722));
            m410();
            if (!Float.isNaN(f)) {
                f2 = f;
            }
            this.f732 = f2;
            if (Float.isNaN(f)) {
                Log.v("MotionLayout", C2369.m6353() + " transitionToStart ");
                m407();
                return;
            }
            setProgress(f);
        }
    }

    public void setTransitionDuration(int i) {
        C2131 r0 = this.f721;
        if (r0 == null) {
            Log.e("MotionLayout", "MotionScene not defined");
            return;
        }
        C2131.C2132 r1 = r0.f7407;
        if (r1 != null) {
            r1.f7443 = i;
        } else {
            r0.f7418 = i;
        }
    }

    public void setTransitionListener(AbstractC0133 r1) {
        this.f749 = r1;
    }

    public void setTransitionState(Bundle bundle) {
        if (this.f733 == null) {
            this.f733 = new C0129();
        }
        this.f733.m438(bundle);
        if (isAttachedToWindow()) {
            this.f733.m437();
        }
    }

    public String toString() {
        Context context = getContext();
        return C2369.m6314(context, this.f705) + "->" + C2369.m6314(context, this.f722) + " (pos:" + this.f732 + " Dpos/Dt:" + this.f746;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean m405() {
        return this.f740;
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public void m406() {
        C2131.C2132 r0;
        C2130 r02;
        View view;
        C2131 r03 = this.f721;
        if (r03 != null) {
            if (r03.m5642(this, this.f742)) {
                requestLayout();
                return;
            }
            int i = this.f742;
            if (i != -1) {
                C2131 r2 = this.f721;
                Iterator<C2131.C2132> it2 = r2.f7411.iterator();
                while (it2.hasNext()) {
                    C2131.C2132 next = it2.next();
                    if (next.f7444.size() > 0) {
                        Iterator<C2131.C2132.View$OnClickListenerC2133> it3 = next.f7444.iterator();
                        while (it3.hasNext()) {
                            it3.next().m5647(this);
                        }
                    }
                }
                Iterator<C2131.C2132> it4 = r2.f7416.iterator();
                while (it4.hasNext()) {
                    C2131.C2132 next2 = it4.next();
                    if (next2.f7444.size() > 0) {
                        Iterator<C2131.C2132.View$OnClickListenerC2133> it5 = next2.f7444.iterator();
                        while (it5.hasNext()) {
                            it5.next().m5647(this);
                        }
                    }
                }
                Iterator<C2131.C2132> it6 = r2.f7411.iterator();
                while (it6.hasNext()) {
                    C2131.C2132 next3 = it6.next();
                    if (next3.f7444.size() > 0) {
                        Iterator<C2131.C2132.View$OnClickListenerC2133> it7 = next3.f7444.iterator();
                        while (it7.hasNext()) {
                            it7.next().m5648(this, i, next3);
                        }
                    }
                }
                Iterator<C2131.C2132> it8 = r2.f7416.iterator();
                while (it8.hasNext()) {
                    C2131.C2132 next4 = it8.next();
                    if (next4.f7444.size() > 0) {
                        Iterator<C2131.C2132.View$OnClickListenerC2133> it9 = next4.f7444.iterator();
                        while (it9.hasNext()) {
                            it9.next().m5648(this, i, next4);
                        }
                    }
                }
            }
            if (this.f721.m5645() && (r0 = this.f721.f7407) != null && (r02 = r0.f7437) != null) {
                int i2 = r02.f7403;
                if (i2 != -1) {
                    view = r02.f7399.findViewById(i2);
                    if (view == null) {
                        StringBuilder r22 = C1293.m3416("cannot find TouchAnchorId @id/");
                        r22.append(C2369.m6314(r02.f7399.getContext(), r02.f7403));
                        Log.e("TouchResponse", r22.toString());
                    }
                } else {
                    view = null;
                }
                if (view instanceof NestedScrollView) {
                    NestedScrollView nestedScrollView = (NestedScrollView) view;
                    nestedScrollView.setOnTouchListener(new View$OnTouchListenerC2111(r02));
                    nestedScrollView.setOnScrollChangeListener(new C2165(r02));
                }
            }
        }
    }

    /* renamed from: ᨨ  reason: contains not printable characters */
    public void m407() {
        m413(0.0f);
    }

    /* renamed from: ⁱ  reason: contains not printable characters */
    public void m410() {
        this.f701.m439();
        invalidate();
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public final void m424() {
        ArrayList<AbstractC0133> arrayList;
        if (this.f749 != null || ((arrayList = this.f747) != null && !arrayList.isEmpty())) {
            Iterator<Integer> it2 = this.f735.iterator();
            while (it2.hasNext()) {
                Integer next = it2.next();
                AbstractC0133 r2 = this.f749;
                if (r2 != null) {
                    r2.m445(this, next.intValue());
                }
                ArrayList<AbstractC0133> arrayList2 = this.f747;
                if (arrayList2 != null) {
                    Iterator<AbstractC0133> it3 = arrayList2.iterator();
                    while (it3.hasNext()) {
                        it3.next().m445(this, next.intValue());
                    }
                }
            }
            this.f735.clear();
        }
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public AbstractC0127 m425() {
        C0131.f779.f780 = VelocityTracker.obtain();
        return C0131.f779;
    }

    /* renamed from: 㿎  reason: contains not printable characters */
    public void m426() {
        m413(1.0f);
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m409(int i) {
        if (!isAttachedToWindow()) {
            if (this.f733 == null) {
                this.f733 = new C0129();
            }
            this.f733.f777 = i;
            return;
        }
        m418(i, -1, -1);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m417(int i, int i2) {
        if (!isAttachedToWindow()) {
            if (this.f733 == null) {
                this.f733 = new C0129();
            }
            C0129 r0 = this.f733;
            r0.f773 = i;
            r0.f777 = i2;
            return;
        }
        C2131 r02 = this.f721;
        if (r02 != null) {
            this.f705 = i;
            this.f722 = i2;
            r02.m5636(i, i2);
            this.f701.m442(this.f721.m5635(i), this.f721.m5635(i2));
            m410();
            this.f732 = 0.0f;
            m407();
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m408() {
        int i;
        ArrayList<AbstractC0133> arrayList;
        if ((this.f749 != null || ((arrayList = this.f747) != null && !arrayList.isEmpty())) && this.f720 == -1) {
            this.f720 = this.f742;
            if (!this.f735.isEmpty()) {
                ArrayList<Integer> arrayList2 = this.f735;
                i = arrayList2.get(arrayList2.size() - 1).intValue();
            } else {
                i = -1;
            }
            int i2 = this.f742;
            if (!(i == i2 || i2 == -1)) {
                this.f735.add(Integer.valueOf(i2));
            }
        }
        m424();
    }

    @Override // androidx.constraintlayout.widget.ConstraintLayout
    public void setState(int i, int i2, int i3) {
        setState(TransitionState.SETUP);
        this.f742 = i;
        this.f705 = -1;
        this.f722 = -1;
        C2065 k = this.mConstraintLayoutSpec;
        if (k != null) {
            k.m5390(i, (float) i2, (float) i3);
            return;
        }
        C2131 r3 = this.f721;
        if (r3 != null) {
            r3.m5635(i).m5374((ConstraintLayout) this, true);
            setConstraintSet(null);
            requestLayout();
        }
    }

    /* renamed from: androidx.constraintlayout.motion.widget.MotionLayout$ⁱ  reason: contains not printable characters */
    public class C0129 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public int f773 = -1;

        /* renamed from: ῲ  reason: contains not printable characters */
        public float f775 = Float.NaN;

        /* renamed from: K  reason: contains not printable characters */
        public float f776 = Float.NaN;

        /* renamed from: 㸾  reason: contains not printable characters */
        public int f777 = -1;

        public C0129() {
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public Bundle m436() {
            Bundle bundle = new Bundle();
            bundle.putFloat("motion.progress", this.f776);
            bundle.putFloat("motion.velocity", this.f775);
            bundle.putInt("motion.StartState", this.f773);
            bundle.putInt("motion.EndState", this.f777);
            return bundle;
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m437() {
            if (!(this.f773 == -1 && this.f777 == -1)) {
                int i = this.f773;
                if (i == -1) {
                    MotionLayout.this.m409(this.f777);
                } else {
                    int i2 = this.f777;
                    if (i2 == -1) {
                        MotionLayout.this.setState(i, -1, -1);
                    } else {
                        MotionLayout.this.m417(i, i2);
                    }
                }
                MotionLayout.this.setState(TransitionState.SETUP);
            }
            if (!Float.isNaN(this.f775)) {
                MotionLayout.this.m414(this.f776, this.f775);
                this.f776 = Float.NaN;
                this.f775 = Float.NaN;
                this.f773 = -1;
                this.f777 = -1;
            } else if (!Float.isNaN(this.f776)) {
                MotionLayout.this.setProgress(this.f776);
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m438(Bundle bundle) {
            this.f776 = bundle.getFloat("motion.progress");
            this.f775 = bundle.getFloat("motion.velocity");
            this.f773 = bundle.getInt("motion.StartState");
            this.f777 = bundle.getInt("motion.EndState");
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m414(float f, float f2) {
        if (!isAttachedToWindow()) {
            if (this.f733 == null) {
                this.f733 = new C0129();
            }
            C0129 r0 = this.f733;
            r0.f776 = f;
            r0.f775 = f2;
            return;
        }
        setProgress(f);
        setState(TransitionState.MOVING);
        this.f746 = f2;
        m413(1.0f);
    }

    /* renamed from: androidx.constraintlayout.motion.widget.MotionLayout$㸾  reason: contains not printable characters */
    public class C0132 {

        /* renamed from: ʬ  reason: contains not printable characters */
        public C2059 f781 = null;

        /* renamed from: ඓ  reason: contains not printable characters */
        public int f782;

        /* renamed from: ῲ  reason: contains not printable characters */
        public C2082 f783 = new C2082();

        /* renamed from: K  reason: contains not printable characters */
        public C2082 f785 = new C2082();

        /* renamed from: 㴹  reason: contains not printable characters */
        public int f786;

        /* renamed from: 㸾  reason: contains not printable characters */
        public C2059 f787 = null;

        public C0132() {
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public void m439() {
            int i;
            int i2;
            MotionLayout motionLayout = MotionLayout.this;
            int i3 = motionLayout.f748;
            int i4 = motionLayout.f718;
            int mode = View.MeasureSpec.getMode(i3);
            int mode2 = View.MeasureSpec.getMode(i4);
            MotionLayout motionLayout2 = MotionLayout.this;
            motionLayout2.f710 = mode;
            motionLayout2.f719 = mode2;
            int optimizationLevel = motionLayout2.getOptimizationLevel();
            MotionLayout motionLayout3 = MotionLayout.this;
            if (motionLayout3.f742 == motionLayout3.getStartState()) {
                MotionLayout.this.resolveSystem(this.f783, optimizationLevel, i3, i4);
                if (this.f781 != null) {
                    MotionLayout.this.resolveSystem(this.f785, optimizationLevel, i3, i4);
                }
            } else {
                if (this.f781 != null) {
                    MotionLayout.this.resolveSystem(this.f785, optimizationLevel, i3, i4);
                }
                MotionLayout.this.resolveSystem(this.f783, optimizationLevel, i3, i4);
            }
            int i5 = 0;
            boolean z = true;
            if (((MotionLayout.this.getParent() instanceof MotionLayout) && mode == 1073741824 && mode2 == 1073741824) ? false : true) {
                MotionLayout motionLayout4 = MotionLayout.this;
                motionLayout4.f710 = mode;
                motionLayout4.f719 = mode2;
                if (motionLayout4.f742 == motionLayout4.getStartState()) {
                    MotionLayout.this.resolveSystem(this.f783, optimizationLevel, i3, i4);
                    if (this.f781 != null) {
                        MotionLayout.this.resolveSystem(this.f785, optimizationLevel, i3, i4);
                    }
                } else {
                    if (this.f781 != null) {
                        MotionLayout.this.resolveSystem(this.f785, optimizationLevel, i3, i4);
                    }
                    MotionLayout.this.resolveSystem(this.f783, optimizationLevel, i3, i4);
                }
                MotionLayout.this.f739 = this.f785.m478();
                MotionLayout.this.f728 = this.f785.m473();
                MotionLayout.this.f731 = this.f783.m478();
                MotionLayout.this.f693 = this.f783.m473();
                MotionLayout motionLayout5 = MotionLayout.this;
                motionLayout5.f706 = (motionLayout5.f739 == motionLayout5.f731 && motionLayout5.f728 == motionLayout5.f693) ? false : true;
            }
            MotionLayout motionLayout6 = MotionLayout.this;
            int i6 = motionLayout6.f739;
            int i7 = motionLayout6.f728;
            int i8 = motionLayout6.f710;
            if (i8 == Integer.MIN_VALUE || i8 == 0) {
                MotionLayout motionLayout7 = MotionLayout.this;
                int i9 = motionLayout7.f739;
                i = (int) ((motionLayout7.f696 * ((float) (motionLayout7.f731 - i9))) + ((float) i9));
            } else {
                i = i6;
            }
            int i10 = MotionLayout.this.f719;
            if (i10 == Integer.MIN_VALUE || i10 == 0) {
                MotionLayout motionLayout8 = MotionLayout.this;
                int i11 = motionLayout8.f728;
                i2 = (int) ((motionLayout8.f696 * ((float) (motionLayout8.f693 - i11))) + ((float) i11));
            } else {
                i2 = i7;
            }
            MotionLayout.this.resolveMeasuredDimension(i3, i4, i, i2, this.f785.f7196 || this.f783.f7196, this.f785.f7197 || this.f783.f7197);
            MotionLayout motionLayout9 = MotionLayout.this;
            int childCount = motionLayout9.getChildCount();
            motionLayout9.f701.m441();
            motionLayout9.f700 = true;
            int width = motionLayout9.getWidth();
            int height = motionLayout9.getHeight();
            C2131.C2132 r4 = motionLayout9.f721.f7407;
            int i12 = r4 != null ? r4.f7429 : -1;
            if (i12 != -1) {
                for (int i13 = 0; i13 < childCount; i13++) {
                    C2110 r6 = motionLayout9.f716.get(motionLayout9.getChildAt(i13));
                    if (r6 != null) {
                        r6.f7348 = i12;
                    }
                }
            }
            for (int i14 = 0; i14 < childCount; i14++) {
                C2110 r5 = motionLayout9.f716.get(motionLayout9.getChildAt(i14));
                if (r5 != null) {
                    motionLayout9.f721.m5640(r5);
                    r5.m5592(width, height, motionLayout9.getNanoTime());
                }
            }
            float r2 = motionLayout9.f721.m5643();
            if (r2 != 0.0f) {
                boolean z2 = ((double) r2) < 0.0d;
                float abs = Math.abs(r2);
                float f = Float.MAX_VALUE;
                int i15 = 0;
                float f2 = Float.MAX_VALUE;
                float f3 = -3.4028235E38f;
                while (true) {
                    if (i15 >= childCount) {
                        z = false;
                        break;
                    }
                    C2110 r11 = motionLayout9.f716.get(motionLayout9.getChildAt(i15));
                    if (!Float.isNaN(r11.f7352)) {
                        break;
                    }
                    C2112 r112 = r11.f7338;
                    float f4 = r112.f7371;
                    float f5 = r112.f7367;
                    float f6 = z2 ? f5 - f4 : f5 + f4;
                    f2 = Math.min(f2, f6);
                    f3 = Math.max(f3, f6);
                    i15++;
                }
                if (z) {
                    float f7 = -3.4028235E38f;
                    for (int i16 = 0; i16 < childCount; i16++) {
                        C2110 r9 = motionLayout9.f716.get(motionLayout9.getChildAt(i16));
                        if (!Float.isNaN(r9.f7352)) {
                            f = Math.min(f, r9.f7352);
                            f7 = Math.max(f7, r9.f7352);
                        }
                    }
                    while (i5 < childCount) {
                        C2110 r42 = motionLayout9.f716.get(motionLayout9.getChildAt(i5));
                        if (!Float.isNaN(r42.f7352)) {
                            r42.f7349 = 1.0f / (1.0f - abs);
                            if (z2) {
                                r42.f7342 = abs - (((f7 - r42.f7352) / (f7 - f)) * abs);
                            } else {
                                r42.f7342 = abs - (((r42.f7352 - f) * abs) / (f7 - f));
                            }
                        }
                        i5++;
                    }
                    return;
                }
                while (i5 < childCount) {
                    C2110 r43 = motionLayout9.f716.get(motionLayout9.getChildAt(i5));
                    C2112 r52 = r43.f7338;
                    float f8 = r52.f7371;
                    float f9 = r52.f7367;
                    float f10 = z2 ? f9 - f8 : f9 + f8;
                    r43.f7349 = 1.0f / (1.0f - abs);
                    r43.f7342 = abs - (((f10 - f2) * abs) / (f3 - f2));
                    i5++;
                }
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m444(C2082 r5, C2082 r6) {
            ConstraintWidget constraintWidget;
            ArrayList<ConstraintWidget> arrayList = r5.f7284;
            HashMap<ConstraintWidget, ConstraintWidget> hashMap = new HashMap<>();
            hashMap.put(r5, r6);
            r6.f7284.clear();
            r6.m494(r5, hashMap);
            Iterator<ConstraintWidget> it2 = arrayList.iterator();
            while (it2.hasNext()) {
                ConstraintWidget next = it2.next();
                if (next instanceof C2103) {
                    constraintWidget = new C2103();
                } else if (next instanceof C2083) {
                    constraintWidget = new C2083();
                } else if (next instanceof C2106) {
                    constraintWidget = new C2106();
                } else if (next instanceof AbstractC2105) {
                    constraintWidget = new C2102();
                } else {
                    constraintWidget = new ConstraintWidget();
                }
                r6.m5569(constraintWidget);
                hashMap.put(next, constraintWidget);
            }
            Iterator<ConstraintWidget> it3 = arrayList.iterator();
            while (it3.hasNext()) {
                ConstraintWidget next2 = it3.next();
                hashMap.get(next2).m494(next2, hashMap);
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public ConstraintWidget m440(C2082 r5, View view) {
            if (r5.f826 == view) {
                return r5;
            }
            ArrayList<ConstraintWidget> arrayList = r5.f7284;
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                ConstraintWidget constraintWidget = arrayList.get(i);
                if (constraintWidget.f826 == view) {
                    return constraintWidget;
                }
            }
            return null;
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m442(C2059 r6, C2059 r7) {
            this.f781 = r6;
            this.f787 = r7;
            this.f785 = new C2082();
            this.f783 = new C2082();
            this.f785.m5477(MotionLayout.this.mLayoutWidget.f7198);
            this.f783.m5477(MotionLayout.this.mLayoutWidget.f7198);
            this.f785.f7284.clear();
            this.f783.f7284.clear();
            m444(MotionLayout.this.mLayoutWidget, this.f785);
            m444(MotionLayout.this.mLayoutWidget, this.f783);
            if (((double) MotionLayout.this.f732) > 0.5d) {
                if (r6 != null) {
                    m443(this.f785, r6);
                }
                m443(this.f783, r7);
            } else {
                m443(this.f783, r7);
                if (r6 != null) {
                    m443(this.f785, r6);
                }
            }
            this.f785.f7189 = MotionLayout.this.isRtl();
            this.f785.m5471();
            this.f783.f7189 = MotionLayout.this.isRtl();
            this.f783.m5471();
            ViewGroup.LayoutParams layoutParams = MotionLayout.this.getLayoutParams();
            if (layoutParams != null) {
                if (layoutParams.width == -2) {
                    this.f785.m493(ConstraintWidget.DimensionBehaviour.WRAP_CONTENT);
                    this.f783.m493(ConstraintWidget.DimensionBehaviour.WRAP_CONTENT);
                }
                if (layoutParams.height == -2) {
                    this.f785.m482(ConstraintWidget.DimensionBehaviour.WRAP_CONTENT);
                    this.f783.m482(ConstraintWidget.DimensionBehaviour.WRAP_CONTENT);
                }
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public final void m443(C2082 r12, C2059 r13) {
            SparseArray<ConstraintWidget> sparseArray = new SparseArray<>();
            Constraints.C0142 k = new Constraints.C0142(-2, -2);
            sparseArray.clear();
            sparseArray.put(0, r12);
            sparseArray.put(MotionLayout.this.getId(), r12);
            Iterator<ConstraintWidget> it2 = r12.f7284.iterator();
            while (it2.hasNext()) {
                ConstraintWidget next = it2.next();
                sparseArray.put(((View) next.f826).getId(), next);
            }
            Iterator<ConstraintWidget> it3 = r12.f7284.iterator();
            while (it3.hasNext()) {
                ConstraintWidget next2 = it3.next();
                View view = (View) next2.f826;
                int id = view.getId();
                if (r13.f7006.containsKey(Integer.valueOf(id))) {
                    r13.f7006.get(Integer.valueOf(id)).m5387(k);
                }
                next2.m502(r13.m5369(view.getId()).f7099.f7032);
                next2.m479(r13.m5369(view.getId()).f7099.f7088);
                if (view instanceof ConstraintHelper) {
                    ConstraintHelper constraintHelper = (ConstraintHelper) view;
                    int id2 = constraintHelper.getId();
                    if (r13.f7006.containsKey(Integer.valueOf(id2))) {
                        C2059.C2063 k2 = r13.f7006.get(Integer.valueOf(id2));
                        if (next2 instanceof C2102) {
                            constraintHelper.m561(k2, (C2102) next2, k, sparseArray);
                        }
                    }
                    if (view instanceof Barrier) {
                        ((Barrier) view).m548();
                    }
                }
                int i = Build.VERSION.SDK_INT;
                k.resolveLayoutDirection(MotionLayout.this.getLayoutDirection());
                MotionLayout.this.applyConstraintsFromLayoutParams(false, view, next2, k, sparseArray);
                if (r13.m5369(view.getId()).f7096.f7100 == 1) {
                    next2.f840 = view.getVisibility();
                } else {
                    next2.f840 = r13.m5369(view.getId()).f7096.f7102;
                }
            }
            Iterator<ConstraintWidget> it4 = r12.f7284.iterator();
            while (it4.hasNext()) {
                ConstraintWidget next3 = it4.next();
                if (next3 instanceof C2100) {
                    AbstractC2105 r132 = (AbstractC2105) next3;
                    ((ConstraintHelper) next3.f826).m562(r132, sparseArray);
                    ((C2100) r132).m5551();
                }
            }
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m441() {
            int childCount = MotionLayout.this.getChildCount();
            MotionLayout.this.f716.clear();
            for (int i = 0; i < childCount; i++) {
                View childAt = MotionLayout.this.getChildAt(i);
                MotionLayout.this.f716.put(childAt, new C2110(childAt));
            }
            for (int i2 = 0; i2 < childCount; i2++) {
                View childAt2 = MotionLayout.this.getChildAt(i2);
                C2110 r3 = MotionLayout.this.f716.get(childAt2);
                if (r3 != null) {
                    if (this.f781 != null) {
                        ConstraintWidget r4 = m440(this.f785, childAt2);
                        if (r4 != null) {
                            C2059 r9 = this.f781;
                            C2112 r10 = r3.f7356;
                            r10.f7372 = 0.0f;
                            r10.f7363 = 0.0f;
                            r3.m5593(r10);
                            r3.f7356.m5595((float) r4.m506(), (float) r4.m476(), (float) r4.m478(), (float) r4.m473());
                            C2059.C2063 r102 = r9.m5369(r3.f7344);
                            r3.f7356.m5597(r102);
                            r3.f7352 = r102.f7094.f7015;
                            r3.f7354.m5718(r4, r9, r3.f7344);
                        } else if (MotionLayout.this.f713 != 0) {
                            Log.e("MotionLayout", C2369.m6353() + "no widget for  " + C2369.m6316(childAt2) + " (" + childAt2.getClass().getName() + ")");
                        }
                    }
                    if (this.f787 != null) {
                        ConstraintWidget r42 = m440(this.f783, childAt2);
                        if (r42 != null) {
                            C2059 r2 = this.f787;
                            C2112 r5 = r3.f7338;
                            r5.f7372 = 1.0f;
                            r5.f7363 = 1.0f;
                            r3.m5593(r5);
                            r3.f7338.m5595((float) r42.m506(), (float) r42.m476(), (float) r42.m478(), (float) r42.m473());
                            r3.f7338.m5597(r2.m5369(r3.f7344));
                            r3.f7345.m5718(r42, r2, r3.f7344);
                        } else if (MotionLayout.this.f713 != 0) {
                            Log.e("MotionLayout", C2369.m6353() + "no widget for  " + C2369.m6316(childAt2) + " (" + childAt2.getClass().getName() + ")");
                        }
                    }
                }
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:19:0x0056, code lost:
        if ((((r15 * r6) - (((r1 * r6) * r6) / 2.0f)) + r13) > 1.0f) goto L_0x006a;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:21:0x0066, code lost:
        if ((((((r1 * r3) * r3) / 2.0f) + (r15 * r3)) + r13) < 0.0f) goto L_0x006a;
     */
    /* renamed from: K  reason: contains not printable characters */
    public void m415(int i, float f, float f2) {
        C2130 r0;
        C2130 r13;
        if (this.f721 != null && this.f732 != f) {
            boolean z = true;
            this.f711 = true;
            this.f729 = getNanoTime();
            this.f750 = ((float) this.f721.m5629()) / 1000.0f;
            this.f714 = f;
            this.f700 = true;
            if (i == 0 || i == 1 || i == 2) {
                if (i == 1) {
                    f = 0.0f;
                } else if (i == 2) {
                    f = 1.0f;
                }
                C2189 r3 = this.f725;
                float f3 = this.f732;
                float f4 = this.f750;
                float r8 = this.f721.m5628();
                C2131.C2132 r02 = this.f721.f7407;
                r3.m5752(f3, f, f2, f4, r8, (r02 == null || (r0 = r02.f7437) == null) ? 0.0f : r0.f7389);
                int i2 = this.f742;
                this.f714 = f;
                this.f742 = i2;
                this.f692 = this.f725;
            } else if (i != 3) {
                if (i == 4) {
                    C0128 r132 = this.f727;
                    float f5 = this.f732;
                    float r03 = this.f721.m5628();
                    r132.f771 = f2;
                    r132.f770 = f5;
                    r132.f769 = r03;
                    this.f692 = this.f727;
                } else if (i == 5) {
                    float f6 = this.f732;
                    float r1 = this.f721.m5628();
                    if (f2 > 0.0f) {
                        float f7 = f2 / r1;
                    } else {
                        float f8 = (-f2) / r1;
                    }
                    z = false;
                    if (z) {
                        C0128 r133 = this.f727;
                        float f9 = this.f732;
                        float r04 = this.f721.m5628();
                        r133.f771 = f2;
                        r133.f770 = f9;
                        r133.f769 = r04;
                        this.f692 = this.f727;
                    } else {
                        C2189 r5 = this.f725;
                        float f10 = this.f732;
                        float f11 = this.f750;
                        float r10 = this.f721.m5628();
                        C2131.C2132 r134 = this.f721.f7407;
                        r5.m5752(f10, f, f2, f11, r10, (r134 == null || (r13 = r134.f7437) == null) ? 0.0f : r13.f7389);
                        this.f746 = 0.0f;
                        int i3 = this.f742;
                        this.f714 = f;
                        this.f742 = i3;
                        this.f692 = this.f725;
                    }
                }
            }
            this.f734 = false;
            this.f729 = getNanoTime();
            invalidate();
        }
    }

    public void setTransition(C2131.C2132 r4) {
        long j;
        C2130 r1;
        C2131 r0 = this.f721;
        r0.f7407 = r4;
        C2131.C2132 r12 = r0.f7407;
        if (!(r12 == null || (r1 = r12.f7437) == null)) {
            r1.m5625(r0.f7420);
        }
        setState(TransitionState.SETUP);
        if (this.f742 == this.f721.m5627()) {
            this.f732 = 1.0f;
            this.f697 = 1.0f;
            this.f714 = 1.0f;
        } else {
            this.f732 = 0.0f;
            this.f697 = 0.0f;
            this.f714 = 0.0f;
        }
        boolean z = true;
        if ((r4.f7439 & 1) == 0) {
            z = false;
        }
        if (z) {
            j = -1;
        } else {
            j = getNanoTime();
        }
        this.f699 = j;
        int r42 = this.f721.m5632();
        int r02 = this.f721.m5627();
        if (r42 != this.f705 || r02 != this.f722) {
            this.f705 = r42;
            this.f722 = r02;
            this.f721.m5636(this.f705, this.f722);
            this.f701.m442(this.f721.m5635(this.f705), this.f721.m5635(this.f722));
            C0132 r43 = this.f701;
            int i = this.f705;
            int i2 = this.f722;
            r43.f782 = i;
            r43.f786 = i2;
            r43.m439();
            m410();
        }
    }

    public MotionLayout(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        m420(attributeSet);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m413(float f) {
        if (this.f721 != null) {
            float f2 = this.f732;
            float f3 = this.f697;
            if (f2 != f3 && this.f734) {
                this.f732 = f3;
            }
            float f4 = this.f732;
            if (f4 != f) {
                this.f711 = false;
                this.f714 = f;
                this.f750 = ((float) this.f721.m5629()) / 1000.0f;
                setProgress(this.f714);
                this.f692 = this.f721.m5644();
                this.f734 = false;
                this.f729 = getNanoTime();
                this.f700 = true;
                this.f697 = f4;
                this.f732 = f4;
                invalidate();
            }
        }
    }

    public MotionLayout(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        m420(attributeSet);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m418(int i, int i2, int i3) {
        C2068 r0;
        int i4;
        C2131 r02 = this.f721;
        if (!(r02 == null || (r0 = r02.f7415) == null)) {
            int i5 = this.f742;
            float f = (float) i2;
            float f2 = (float) i3;
            C2068.C2070 k = r0.f7124.get(i);
            if (k == null) {
                i4 = i;
            } else {
                if (f != -1.0f && f2 != -1.0f) {
                    Iterator<C2068.C2069> it2 = k.f7131.iterator();
                    C2068.C2069 r5 = null;
                    while (true) {
                        if (it2.hasNext()) {
                            C2068.C2069 next = it2.next();
                            if (next.m5396(f, f2)) {
                                if (i5 == next.f7126) {
                                    break;
                                }
                                r5 = next;
                            }
                        } else if (r5 != null) {
                            i4 = r5.f7126;
                        } else {
                            i4 = k.f7130;
                        }
                    }
                } else if (k.f7130 != i5) {
                    Iterator<C2068.C2069> it3 = k.f7131.iterator();
                    while (true) {
                        if (it3.hasNext()) {
                            if (i5 == it3.next().f7126) {
                                break;
                            }
                        } else {
                            i4 = k.f7130;
                            break;
                        }
                    }
                }
                i4 = i5;
            }
            if (i4 != -1) {
                i = i4;
            }
        }
        int i6 = this.f742;
        if (i6 != i) {
            if (this.f705 == i) {
                m413(0.0f);
            } else if (this.f722 == i) {
                m413(1.0f);
            } else {
                this.f722 = i;
                if (i6 != -1) {
                    m417(i6, i);
                    m413(1.0f);
                    this.f732 = 0.0f;
                    m426();
                    return;
                }
                this.f711 = false;
                this.f714 = 1.0f;
                this.f697 = 0.0f;
                this.f732 = 0.0f;
                this.f699 = getNanoTime();
                this.f729 = getNanoTime();
                this.f734 = false;
                this.f692 = null;
                this.f750 = ((float) this.f721.m5629()) / 1000.0f;
                this.f705 = -1;
                this.f721.m5636(this.f705, this.f722);
                this.f721.m5632();
                int childCount = getChildCount();
                this.f716.clear();
                for (int i7 = 0; i7 < childCount; i7++) {
                    View childAt = getChildAt(i7);
                    this.f716.put(childAt, new C2110(childAt));
                }
                this.f700 = true;
                this.f701.m442((C2059) null, this.f721.m5635(i));
                m410();
                this.f701.m441();
                int childCount2 = getChildCount();
                for (int i8 = 0; i8 < childCount2; i8++) {
                    View childAt2 = getChildAt(i8);
                    C2110 r52 = this.f716.get(childAt2);
                    if (r52 != null) {
                        C2112 r6 = r52.f7356;
                        r6.f7372 = 0.0f;
                        r6.f7363 = 0.0f;
                        r6.m5595(childAt2.getX(), childAt2.getY(), (float) childAt2.getWidth(), (float) childAt2.getHeight());
                        r52.f7354.m5717(childAt2);
                    }
                }
                int width = getWidth();
                int height = getHeight();
                for (int i9 = 0; i9 < childCount; i9++) {
                    C2110 r53 = this.f716.get(getChildAt(i9));
                    this.f721.m5640(r53);
                    r53.m5592(width, height, getNanoTime());
                }
                C2131.C2132 r12 = this.f721.f7407;
                float f3 = r12 != null ? r12.f7433 : 0.0f;
                if (f3 != 0.0f) {
                    float f4 = Float.MAX_VALUE;
                    float f5 = -3.4028235E38f;
                    for (int i10 = 0; i10 < childCount; i10++) {
                        C2112 r62 = this.f716.get(getChildAt(i10)).f7338;
                        float f6 = r62.f7367 + r62.f7371;
                        f4 = Math.min(f4, f6);
                        f5 = Math.max(f5, f6);
                    }
                    for (int i11 = 0; i11 < childCount; i11++) {
                        C2110 r2 = this.f716.get(getChildAt(i11));
                        C2112 r63 = r2.f7338;
                        float f7 = r63.f7371;
                        float f8 = r63.f7367;
                        r2.f7349 = 1.0f / (1.0f - f3);
                        r2.f7342 = f3 - ((((f7 + f8) - f4) * f3) / (f5 - f4));
                    }
                }
                this.f697 = 0.0f;
                this.f732 = 0.0f;
                this.f700 = true;
                invalidate();
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m421(View view, float f, float f2, float[] fArr, int i) {
        float f3;
        AbstractC2113 r13;
        double[] dArr;
        float f4 = this.f746;
        float f5 = this.f732;
        if (this.f692 != null) {
            float signum = Math.signum(this.f714 - f5);
            float interpolation = this.f692.getInterpolation(this.f732 + 1.0E-5f);
            float interpolation2 = this.f692.getInterpolation(this.f732);
            f4 = (((interpolation - interpolation2) / 1.0E-5f) * signum) / this.f750;
            f5 = interpolation2;
        }
        Interpolator interpolator = this.f692;
        if (interpolator instanceof Abstractanimation.InterpolatorC2160) {
            f4 = ((Abstractanimation.InterpolatorC2160) interpolator).m5680();
        }
        C2110 r1 = this.f716.get(view);
        if ((i & 1) == 0) {
            int width = view.getWidth();
            int height = view.getHeight();
            float r2 = r1.m5590(f5, r1.f7335);
            HashMap<String, AbstractC2113> hashMap = r1.f7353;
            AbstractC2113 r3 = hashMap == null ? null : hashMap.get("translationX");
            HashMap<String, AbstractC2113> hashMap2 = r1.f7353;
            AbstractC2113 r6 = hashMap2 == null ? null : hashMap2.get("translationY");
            HashMap<String, AbstractC2113> hashMap3 = r1.f7353;
            AbstractC2113 r5 = hashMap3 == null ? null : hashMap3.get("rotation");
            HashMap<String, AbstractC2113> hashMap4 = r1.f7353;
            if (hashMap4 == null) {
                f3 = f4;
                r13 = null;
            } else {
                r13 = hashMap4.get("scaleX");
                f3 = f4;
            }
            HashMap<String, AbstractC2113> hashMap5 = r1.f7353;
            AbstractC2113 r12 = hashMap5 == null ? null : hashMap5.get("scaleY");
            HashMap<String, AbstractC2140> hashMap6 = r1.f7339;
            AbstractC2140 r4 = hashMap6 == null ? null : hashMap6.get("translationX");
            HashMap<String, AbstractC2140> hashMap7 = r1.f7339;
            AbstractC2140 r7 = hashMap7 == null ? null : hashMap7.get("translationY");
            HashMap<String, AbstractC2140> hashMap8 = r1.f7339;
            AbstractC2140 r9 = hashMap8 == null ? null : hashMap8.get("rotation");
            HashMap<String, AbstractC2140> hashMap9 = r1.f7339;
            AbstractC2140 r0 = hashMap9 == null ? null : hashMap9.get("scaleX");
            HashMap<String, AbstractC2140> hashMap10 = r1.f7339;
            AbstractC2140 r11 = hashMap10 == null ? null : hashMap10.get("scaleY");
            C2194 r14 = new C2194();
            r14.m5778();
            r14.m5780(r5, r2);
            r14.m5776(r3, r6, r2);
            r14.m5781(r13, r12, r2);
            r14.m5782(r9, r2);
            r14.m5777(r4, r7, r2);
            r14.m5783(r0, r11, r2);
            AbstractC2187 r02 = r1.f7343;
            if (r02 != null) {
                double[] dArr2 = r1.f7334;
                if (dArr2.length > 0) {
                    double d = (double) r2;
                    r02.m5740(d, dArr2);
                    r1.f7343.m5738(d, r1.f7350);
                    r1.f7356.m5596(f, f2, fArr, r1.f7359, r1.f7350, r1.f7334);
                }
                r14.m5779(f, f2, width, height, fArr);
            } else if (r1.f7357 != null) {
                double r42 = (double) r1.m5590(r2, r1.f7335);
                r1.f7357[0].m5738(r42, r1.f7350);
                r1.f7357[0].m5740(r42, r1.f7334);
                float f6 = r1.f7335[0];
                int i2 = 0;
                while (true) {
                    dArr = r1.f7350;
                    if (i2 >= dArr.length) {
                        break;
                    }
                    dArr[i2] = dArr[i2] * ((double) f6);
                    i2++;
                }
                r1.f7356.m5596(f, f2, fArr, r1.f7359, dArr, r1.f7334);
                r14.m5779(f, f2, width, height, fArr);
            } else {
                C2112 r03 = r1.f7338;
                float f7 = r03.f7371;
                C2112 r15 = r1.f7356;
                float f8 = f7 - r15.f7371;
                float f9 = r03.f7367 - r15.f7367;
                fArr[0] = (((r03.f7373 - r15.f7373) + f8) * f) + ((1.0f - f) * f8);
                fArr[1] = (((r03.f7365 - r15.f7365) + f9) * f2) + ((1.0f - f2) * f9);
                r14.m5778();
                r14.m5780(r5, r2);
                r14.m5776(r3, r6, r2);
                r14.m5781(r13, r12, r2);
                r14.m5782(r9, r2);
                r14.m5777(r4, r7, r2);
                r14.m5783(r0, r11, r2);
                r14.m5779(f, f2, width, height, fArr);
            }
        } else {
            f3 = f4;
            r1.m5591(f5, f, f2, fArr);
        }
        if (i < 2) {
            fArr[0] = fArr[0] * f3;
            fArr[1] = fArr[1] * f3;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m422(boolean z) {
        float f;
        boolean z2;
        int i;
        int i2;
        if (this.f699 == -1) {
            this.f699 = getNanoTime();
        }
        float f2 = this.f732;
        if (f2 > 0.0f && f2 < 1.0f) {
            this.f742 = -1;
        }
        boolean z3 = false;
        if (this.f738 || (this.f700 && (z || this.f714 != this.f732))) {
            float signum = Math.signum(this.f714 - this.f732);
            long nanoTime = getNanoTime();
            if (!(this.f692 instanceof Abstractanimation.InterpolatorC2160)) {
                f = ((((float) (nanoTime - this.f699)) * signum) * 1.0E-9f) / this.f750;
                this.f746 = f;
            } else {
                f = 0.0f;
            }
            float f3 = this.f732 + f;
            if (this.f734) {
                f3 = this.f714;
            }
            int i3 = (signum > 0.0f ? 1 : (signum == 0.0f ? 0 : -1));
            if ((i3 <= 0 || f3 < this.f714) && (signum > 0.0f || f3 > this.f714)) {
                z2 = false;
            } else {
                f3 = this.f714;
                this.f700 = false;
                z2 = true;
            }
            this.f732 = f3;
            this.f697 = f3;
            this.f699 = nanoTime;
            Interpolator interpolator = this.f692;
            if (interpolator != null && !z2) {
                if (this.f711) {
                    float interpolation = interpolator.getInterpolation(((float) (nanoTime - this.f729)) * 1.0E-9f);
                    this.f732 = interpolation;
                    this.f699 = nanoTime;
                    Interpolator interpolator2 = this.f692;
                    if (interpolator2 instanceof Abstractanimation.InterpolatorC2160) {
                        float r2 = ((Abstractanimation.InterpolatorC2160) interpolator2).m5680();
                        this.f746 = r2;
                        if (Math.abs(r2) * this.f750 <= 1.0E-5f) {
                            this.f700 = false;
                        }
                        if (r2 > 0.0f && interpolation >= 1.0f) {
                            this.f732 = 1.0f;
                            this.f700 = false;
                            interpolation = 1.0f;
                        }
                        if (r2 < 0.0f && interpolation <= 0.0f) {
                            this.f732 = 0.0f;
                            this.f700 = false;
                            f3 = 0.0f;
                        }
                    }
                    f3 = interpolation;
                } else {
                    float interpolation2 = interpolator.getInterpolation(f3);
                    Interpolator interpolator3 = this.f692;
                    if (interpolator3 instanceof Abstractanimation.InterpolatorC2160) {
                        this.f746 = ((Abstractanimation.InterpolatorC2160) interpolator3).m5680();
                    } else {
                        this.f746 = ((interpolator3.getInterpolation(f3 + f) - interpolation2) * signum) / f;
                    }
                    f3 = interpolation2;
                }
            }
            if (Math.abs(this.f746) > 1.0E-5f) {
                setState(TransitionState.MOVING);
            }
            if ((i3 > 0 && f3 >= this.f714) || (signum <= 0.0f && f3 <= this.f714)) {
                f3 = this.f714;
                this.f700 = false;
            }
            int i4 = (f3 > 1.0f ? 1 : (f3 == 1.0f ? 0 : -1));
            if (i4 >= 0 || f3 <= 0.0f) {
                this.f700 = false;
                setState(TransitionState.FINISHED);
            }
            int childCount = getChildCount();
            this.f738 = false;
            long nanoTime2 = getNanoTime();
            this.f696 = f3;
            for (int i5 = 0; i5 < childCount; i5++) {
                View childAt = getChildAt(i5);
                C2110 r16 = this.f716.get(childAt);
                if (r16 != null) {
                    this.f738 = r16.m5594(childAt, f3, nanoTime2, this.f743) | this.f738;
                }
            }
            boolean z4 = (i3 > 0 && f3 >= this.f714) || (signum <= 0.0f && f3 <= this.f714);
            if (!this.f738 && !this.f700 && z4) {
                setState(TransitionState.FINISHED);
            }
            if (this.f706) {
                requestLayout();
            }
            this.f738 = (!z4) | this.f738;
            if (!(f3 > 0.0f || (i2 = this.f705) == -1 || this.f742 == i2)) {
                this.f742 = i2;
                this.f721.m5635(i2).m5373(this);
                setState(TransitionState.FINISHED);
                z3 = true;
            }
            if (((double) f3) >= 1.0d && this.f742 != (i = this.f722)) {
                this.f742 = i;
                this.f721.m5635(i).m5373(this);
                setState(TransitionState.FINISHED);
                z3 = true;
            }
            if (this.f738 || this.f700) {
                invalidate();
            } else if ((i3 > 0 && i4 == 0) || (signum < 0.0f && f3 == 0.0f)) {
                setState(TransitionState.FINISHED);
            }
            if ((!this.f738 && this.f700 && i3 > 0 && i4 == 0) || (signum < 0.0f && f3 == 0.0f)) {
                m406();
            }
        }
        float f4 = this.f732;
        if (f4 >= 1.0f) {
            if (this.f742 != this.f722) {
                z3 = true;
            }
            this.f742 = this.f722;
        } else if (f4 <= 0.0f) {
            if (this.f742 != this.f705) {
                z3 = true;
            }
            this.f742 = this.f705;
        }
        this.f726 |= z3;
        if (z3 && !this.f715) {
            requestLayout();
        }
        this.f697 = this.f732;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m420(AttributeSet attributeSet) {
        C2131 r13;
        String str;
        String str2;
        f691 = isInEditMode();
        if (attributeSet != null) {
            TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, R$styleable.MotionLayout);
            int indexCount = obtainStyledAttributes.getIndexCount();
            boolean z = true;
            for (int i = 0; i < indexCount; i++) {
                int index = obtainStyledAttributes.getIndex(i);
                if (index == R$styleable.MotionLayout_layoutDescription) {
                    this.f721 = new C2131(getContext(), this, obtainStyledAttributes.getResourceId(index, -1));
                } else if (index == R$styleable.MotionLayout_currentState) {
                    this.f742 = obtainStyledAttributes.getResourceId(index, -1);
                } else if (index == R$styleable.MotionLayout_motionProgress) {
                    this.f714 = obtainStyledAttributes.getFloat(index, 0.0f);
                    this.f700 = true;
                } else if (index == R$styleable.MotionLayout_applyMotionScene) {
                    z = obtainStyledAttributes.getBoolean(index, z);
                } else if (index == R$styleable.MotionLayout_showPaths) {
                    if (this.f713 == 0) {
                        this.f713 = obtainStyledAttributes.getBoolean(index, false) ? 2 : 0;
                    }
                } else if (index == R$styleable.MotionLayout_motionDebug) {
                    this.f713 = obtainStyledAttributes.getInt(index, 0);
                }
            }
            obtainStyledAttributes.recycle();
            if (this.f721 == null) {
                Log.e("MotionLayout", "WARNING NO app:layoutDescription tag");
            }
            if (!z) {
                this.f721 = null;
            }
        }
        if (this.f713 != 0) {
            C2131 r132 = this.f721;
            if (r132 == null) {
                Log.e("MotionLayout", "CHECK: motion scene not set! set \"app:layoutDescription=\"@xml/file\"");
            } else {
                int r133 = r132.m5632();
                C2131 r4 = this.f721;
                C2059 r42 = r4.m5635(r4.m5632());
                String r134 = C2369.m6314(getContext(), r133);
                int childCount = getChildCount();
                for (int i2 = 0; i2 < childCount; i2++) {
                    View childAt = getChildAt(i2);
                    int id = childAt.getId();
                    if (id == -1) {
                        Log.w("MotionLayout", "CHECK: " + r134 + " ALL VIEWS SHOULD HAVE ID's " + childAt.getClass().getName() + " does not!");
                    }
                    if ((r42.f7006.containsKey(Integer.valueOf(id)) ? r42.f7006.get(Integer.valueOf(id)) : null) == null) {
                        Log.w("MotionLayout", "CHECK: " + r134 + " NO CONSTRAINTS for " + C2369.m6316(childAt));
                    }
                }
                Integer[] numArr = (Integer[]) r42.f7006.keySet().toArray(new Integer[0]);
                int[] iArr = new int[numArr.length];
                for (int i3 = 0; i3 < iArr.length; i3++) {
                    iArr[i3] = numArr[i3].intValue();
                }
                for (int i4 = 0; i4 < iArr.length; i4++) {
                    int i5 = iArr[i4];
                    String r6 = C2369.m6314(getContext(), i5);
                    if (findViewById(iArr[i4]) == null) {
                        Log.w("MotionLayout", "CHECK: " + r134 + " NO View matches id " + r6);
                    }
                    if (r42.m5366(i5) == -1) {
                        Log.w("MotionLayout", "CHECK: " + r134 + "(" + r6 + ") no LAYOUT_HEIGHT");
                    }
                    if (r42.m5364(i5) == -1) {
                        Log.w("MotionLayout", "CHECK: " + r134 + "(" + r6 + ") no LAYOUT_HEIGHT");
                    }
                }
                SparseIntArray sparseIntArray = new SparseIntArray();
                SparseIntArray sparseIntArray2 = new SparseIntArray();
                Iterator<C2131.C2132> it2 = this.f721.m5634().iterator();
                while (it2.hasNext()) {
                    C2131.C2132 next = it2.next();
                    if (next == this.f721.f7407) {
                        Log.v("MotionLayout", "CHECK: CURRENT");
                    }
                    StringBuilder r5 = C1293.m3416("CHECK: transition = ");
                    Context context = getContext();
                    if (next.f7442 == -1) {
                        str = "null";
                    } else {
                        str = context.getResources().getResourceEntryName(next.f7442);
                    }
                    if (next.f7427 == -1) {
                        str2 = C1293.m3412(str, " -> null");
                    } else {
                        StringBuilder r7 = C1293.m3402(str, " -> ");
                        r7.append(context.getResources().getResourceEntryName(next.f7427));
                        str2 = r7.toString();
                    }
                    r5.append(str2);
                    Log.v("MotionLayout", r5.toString());
                    Log.v("MotionLayout", "CHECK: transition.setDuration = " + next.f7443);
                    if (next.f7442 == next.f7427) {
                        Log.e("MotionLayout", "CHECK: start and end constraint set should not be the same!");
                    }
                    int i6 = next.f7442;
                    int i7 = next.f7427;
                    String r62 = C2369.m6314(getContext(), i6);
                    String r72 = C2369.m6314(getContext(), i7);
                    if (sparseIntArray.get(i6) == i7) {
                        Log.e("MotionLayout", "CHECK: two transitions with the same start and end " + r62 + "->" + r72);
                    }
                    if (sparseIntArray2.get(i7) == i6) {
                        Log.e("MotionLayout", "CHECK: you can't have reverse transitions" + r62 + "->" + r72);
                    }
                    sparseIntArray.put(i6, i7);
                    sparseIntArray2.put(i7, i6);
                    if (this.f721.m5635(i6) == null) {
                        Log.e("MotionLayout", " no such constraintSetStart " + r62);
                    }
                    if (this.f721.m5635(i7) == null) {
                        Log.e("MotionLayout", " no such constraintSetEnd " + r62);
                    }
                }
            }
        }
        if (this.f742 == -1 && (r13 = this.f721) != null) {
            this.f742 = r13.m5632();
            this.f705 = this.f721.m5632();
            this.f722 = this.f721.m5627();
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final boolean m423(float f, float f2, View view, MotionEvent motionEvent) {
        if (view instanceof ViewGroup) {
            ViewGroup viewGroup = (ViewGroup) view;
            int childCount = viewGroup.getChildCount();
            for (int i = 0; i < childCount; i++) {
                if (m423(((float) view.getLeft()) + f, ((float) view.getTop()) + f2, viewGroup.getChildAt(i), motionEvent)) {
                    return true;
                }
            }
        }
        this.f736.set(((float) view.getLeft()) + f, ((float) view.getTop()) + f2, f + ((float) view.getRight()), f2 + ((float) view.getBottom()));
        if (motionEvent.getAction() == 0) {
            return this.f736.contains(motionEvent.getX(), motionEvent.getY()) && view.onTouchEvent(motionEvent);
        }
        if (view.onTouchEvent(motionEvent)) {
            return true;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m416(int i, float f, float f2, float f3, float[] fArr) {
        String str;
        HashMap<View, C2110> hashMap = this.f716;
        View viewById = getViewById(i);
        C2110 r0 = hashMap.get(viewById);
        if (r0 != null) {
            r0.m5591(f, f2, f3, fArr);
            float y = viewById.getY();
            this.f698 = f;
            this.f744 = y;
            return;
        }
        if (viewById == null) {
            str = C1293.m3408("", i);
        } else {
            str = viewById.getContext().getResources().getResourceName(i);
        }
        Log.w("MotionLayout", "WARNING could not find view id " + str);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m419(int i, boolean z, float f) {
        AbstractC0133 r0 = this.f749;
        if (r0 != null) {
            r0.m448(this, i, z, f);
        }
        ArrayList<AbstractC0133> arrayList = this.f747;
        if (arrayList != null) {
            Iterator<AbstractC0133> it2 = arrayList.iterator();
            while (it2.hasNext()) {
                it2.next().m448(this, i, z, f);
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m412() {
        ArrayList<AbstractC0133> arrayList;
        if ((this.f749 != null || ((arrayList = this.f747) != null && !arrayList.isEmpty())) && this.f702 != this.f697) {
            if (this.f720 != -1) {
                AbstractC0133 r0 = this.f749;
                if (r0 != null) {
                    r0.m446(this, this.f705, this.f722);
                }
                ArrayList<AbstractC0133> arrayList2 = this.f747;
                if (arrayList2 != null) {
                    Iterator<AbstractC0133> it2 = arrayList2.iterator();
                    while (it2.hasNext()) {
                        it2.next().m446(this, this.f705, this.f722);
                    }
                }
            }
            this.f720 = -1;
            float f = this.f697;
            this.f702 = f;
            AbstractC0133 r1 = this.f749;
            if (r1 != null) {
                r1.m447(this, this.f705, this.f722, f);
            }
            ArrayList<AbstractC0133> arrayList3 = this.f747;
            if (arrayList3 != null) {
                Iterator<AbstractC0133> it3 = arrayList3.iterator();
                while (it3.hasNext()) {
                    it3.next().m447(this, this.f705, this.f722, this.f697);
                }
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public C2131.C2132 m411(int i) {
        Iterator<C2131.C2132> it2 = this.f721.f7411.iterator();
        while (it2.hasNext()) {
            C2131.C2132 next = it2.next();
            if (next.f7436 == i) {
                return next;
            }
        }
        return null;
    }
}
