package o;

import android.view.View;
import android.view.ViewGroup;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.material.sidesheet.SideSheetBehavior;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class GK extends AbstractC2378rs0 {
    public final /* synthetic */ int j;
    public final SideSheetBehavior k;

    public /* synthetic */ GK(SideSheetBehavior sideSheetBehavior, int i) {
        this.j = i;
        this.k = sideSheetBehavior;
    }

    @Override // o.AbstractC2378rs0
    public final int D(ViewGroup.MarginLayoutParams marginLayoutParams) {
        switch (this.j) {
            case 0:
                return marginLayoutParams.leftMargin;
            default:
                return marginLayoutParams.rightMargin;
        }
    }

    @Override // o.AbstractC2378rs0
    public final float E(int i) {
        switch (this.j) {
            case 0:
                float fN = N();
                return (i - fN) / (M() - fN);
            default:
                float f = this.k.m;
                return (f - i) / (f - M());
        }
    }

    @Override // o.AbstractC2378rs0
    public final int M() {
        switch (this.j) {
            case 0:
                SideSheetBehavior sideSheetBehavior = this.k;
                return Math.max(0, sideSheetBehavior.n + sideSheetBehavior.f29o);
            default:
                SideSheetBehavior sideSheetBehavior2 = this.k;
                return Math.max(0, (sideSheetBehavior2.m - sideSheetBehavior2.l) - sideSheetBehavior2.f29o);
        }
    }

    @Override // o.AbstractC2378rs0
    public final int N() {
        switch (this.j) {
            case 0:
                SideSheetBehavior sideSheetBehavior = this.k;
                return (-sideSheetBehavior.l) - sideSheetBehavior.f29o;
            default:
                return this.k.m;
        }
    }

    @Override // o.AbstractC2378rs0
    public final int Q() {
        switch (this.j) {
            case 0:
                return this.k.f29o;
            default:
                return this.k.m;
        }
    }

    @Override // o.AbstractC2378rs0
    public final int R() {
        switch (this.j) {
            case 0:
                return -this.k.l;
            default:
                return M();
        }
    }

    @Override // o.AbstractC2378rs0
    public final int S(View view) {
        switch (this.j) {
            case 0:
                return view.getRight() + this.k.f29o;
            default:
                return view.getLeft() - this.k.f29o;
        }
    }

    @Override // o.AbstractC2378rs0
    public final int T(CoordinatorLayout coordinatorLayout) {
        switch (this.j) {
            case 0:
                return coordinatorLayout.getLeft();
            default:
                return coordinatorLayout.getRight();
        }
    }

    @Override // o.AbstractC2378rs0
    public final int W() {
        switch (this.j) {
            case 0:
                return 1;
            default:
                return 0;
        }
    }

    @Override // o.AbstractC2378rs0
    public final boolean Y(float f) {
        switch (this.j) {
            case 0:
                if (f > 0.0f) {
                }
                break;
            default:
                if (f < 0.0f) {
                }
                break;
        }
        return false;
    }

    @Override // o.AbstractC2378rs0
    public final boolean a0(View view) {
        switch (this.j) {
            case 0:
                if (view.getRight() < (M() - N()) / 2) {
                }
                break;
            default:
                if (view.getLeft() > (M() + this.k.m) / 2) {
                }
                break;
        }
        return false;
    }

    @Override // o.AbstractC2378rs0
    public final boolean b0(float f, float f2) {
        switch (this.j) {
            case 0:
                if (Math.abs(f) <= Math.abs(f2) || Math.abs(f) <= 500) {
                }
                break;
            default:
                if (Math.abs(f) <= Math.abs(f2) || Math.abs(f) <= 500) {
                }
                break;
        }
        return false;
    }

    @Override // o.AbstractC2378rs0
    public final boolean g0(View view, float f) {
        switch (this.j) {
            case 0:
                float left = view.getLeft();
                SideSheetBehavior sideSheetBehavior = this.k;
                float fAbs = Math.abs((f * sideSheetBehavior.k) + left);
                sideSheetBehavior.getClass();
                if (fAbs > 0.5f) {
                }
                break;
            default:
                float right = view.getRight();
                SideSheetBehavior sideSheetBehavior2 = this.k;
                float fAbs2 = Math.abs((f * sideSheetBehavior2.k) + right);
                sideSheetBehavior2.getClass();
                if (fAbs2 > 0.5f) {
                }
                break;
        }
        return false;
    }

    @Override // o.AbstractC2378rs0
    public final void m0(ViewGroup.MarginLayoutParams marginLayoutParams, int i, int i2) {
        switch (this.j) {
            case 0:
                if (i <= this.k.m) {
                    marginLayoutParams.leftMargin = i2;
                    break;
                }
                break;
            default:
                int i3 = this.k.m;
                if (i <= i3) {
                    marginLayoutParams.rightMargin = i3 - i;
                    break;
                }
                break;
        }
    }
}
