package o;

import android.view.View;
import android.view.ViewParent;
import com.google.android.material.behavior.SwipeDismissBehavior;
import java.util.WeakHashMap;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Xb0 extends YT {
    public int m;
    public int n = -1;

    /* renamed from: o, reason: collision with root package name */
    public final /* synthetic */ SwipeDismissBehavior f410o;

    public Xb0(SwipeDismissBehavior swipeDismissBehavior) {
        this.f410o = swipeDismissBehavior;
    }

    @Override // o.YT
    public final void J(View view, int i) {
        this.n = i;
        this.m = view.getLeft();
        ViewParent parent = view.getParent();
        if (parent != null) {
            SwipeDismissBehavior swipeDismissBehavior = this.f410o;
            swipeDismissBehavior.c = true;
            parent.requestDisallowInterceptTouchEvent(true);
            swipeDismissBehavior.c = false;
        }
    }

    @Override // o.YT
    public final void L(View view, int i, int i2) {
        float width = view.getWidth();
        SwipeDismissBehavior swipeDismissBehavior = this.f410o;
        float f = width * swipeDismissBehavior.e;
        float width2 = view.getWidth() * swipeDismissBehavior.f;
        float fAbs = Math.abs(i - this.m);
        if (fAbs <= f) {
            view.setAlpha(1.0f);
        } else if (fAbs >= width2) {
            view.setAlpha(0.0f);
        } else {
            view.setAlpha(Math.min(Math.max(0.0f, 1.0f - ((fAbs - f) / (width2 - f))), 1.0f));
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:27:0x0052  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x0061  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x0067  */
    @Override // o.YT
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void M(android.view.View r9, float r10, float r11) {
        /*
            r8 = this;
            r11 = -1
            r8.n = r11
            int r11 = r9.getWidth()
            r0 = 0
            int r1 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
            r2 = 0
            com.google.android.material.behavior.SwipeDismissBehavior r3 = r8.f410o
            r4 = 1
            if (r1 == 0) goto L39
            java.util.WeakHashMap r5 = o.Oj0.a
            int r5 = r9.getLayoutDirection()
            if (r5 != r4) goto L1a
            r5 = r4
            goto L1b
        L1a:
            r5 = r2
        L1b:
            int r6 = r3.d
            r7 = 2
            if (r6 != r7) goto L21
            goto L52
        L21:
            if (r6 != 0) goto L2d
            if (r5 == 0) goto L2a
            int r1 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
            if (r1 >= 0) goto L67
            goto L52
        L2a:
            if (r1 <= 0) goto L67
            goto L52
        L2d:
            if (r6 != r4) goto L67
            if (r5 == 0) goto L34
            if (r1 <= 0) goto L67
            goto L52
        L34:
            int r1 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
            if (r1 >= 0) goto L67
            goto L52
        L39:
            int r1 = r9.getLeft()
            int r5 = r8.m
            int r1 = r1 - r5
            int r5 = r9.getWidth()
            float r5 = (float) r5
            r6 = 1056964608(0x3f000000, float:0.5)
            float r5 = r5 * r6
            int r5 = java.lang.Math.round(r5)
            int r1 = java.lang.Math.abs(r1)
            if (r1 < r5) goto L67
        L52:
            int r10 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
            if (r10 < 0) goto L61
            int r10 = r9.getLeft()
            int r0 = r8.m
            if (r10 >= r0) goto L5f
            goto L61
        L5f:
            int r0 = r0 + r11
            goto L65
        L61:
            int r10 = r8.m
            int r0 = r10 - r11
        L65:
            r2 = r4
            goto L69
        L67:
            int r0 = r8.m
        L69:
            o.Sj0 r10 = r3.a
            int r11 = r9.getTop()
            boolean r10 = r10.n(r0, r11)
            if (r10 == 0) goto L7f
            o.cD r10 = new o.cD
            r10.<init>(r3, r9, r2)
            java.util.WeakHashMap r11 = o.Oj0.a
            r9.postOnAnimation(r10)
        L7f:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: o.Xb0.M(android.view.View, float, float):void");
    }

    @Override // o.YT
    public final boolean X(View view, int i) {
        int i2 = this.n;
        return (i2 == -1 || i2 == i) && this.f410o.r(view);
    }

    @Override // o.YT
    public final int p(View view, int i) {
        int width;
        int width2;
        int width3;
        WeakHashMap weakHashMap = Oj0.a;
        boolean z = view.getLayoutDirection() == 1;
        int i2 = this.f410o.d;
        if (i2 == 0) {
            if (z) {
                width = this.m - view.getWidth();
                width2 = this.m;
            } else {
                width = this.m;
                width3 = view.getWidth();
                width2 = width3 + width;
            }
        } else if (i2 != 1) {
            width = this.m - view.getWidth();
            width2 = view.getWidth() + this.m;
        } else if (z) {
            width = this.m;
            width3 = view.getWidth();
            width2 = width3 + width;
        } else {
            width = this.m - view.getWidth();
            width2 = this.m;
        }
        return Math.min(Math.max(width, i), width2);
    }

    @Override // o.YT
    public final int q(View view, int i) {
        return view.getTop();
    }

    @Override // o.YT
    public final int y(View view) {
        return view.getWidth();
    }

    @Override // o.YT
    public final void K(int i) {
    }
}
