package d1;

import android.view.View;
import androidx.drawerlayout.widget.DrawerLayout;
import com.bumptech.glide.h;
import e.s0;

/* JADX INFO: loaded from: classes.dex */
public final class g extends h {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public y0.h f24927b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final s0 f24928c = new s0(this, 7);

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ DrawerLayout f24929d;

    public g(DrawerLayout drawerLayout, int i10) {
        this.f24929d = drawerLayout;
        this.f24926a = i10;
    }

    @Override // com.bumptech.glide.h
    public final boolean D(int i10, View view) {
        DrawerLayout drawerLayout = this.f24929d;
        drawerLayout.getClass();
        return DrawerLayout.l(view) && drawerLayout.a(this.f24926a, view) && drawerLayout.g(view) == 0;
    }

    @Override // com.bumptech.glide.h
    public final int j(View view, int i10) {
        DrawerLayout drawerLayout = this.f24929d;
        if (drawerLayout.a(3, view)) {
            return Math.max(-view.getWidth(), Math.min(i10, 0));
        }
        int width = drawerLayout.getWidth();
        return Math.max(width - view.getWidth(), Math.min(i10, width));
    }

    @Override // com.bumptech.glide.h
    public final int k(View view, int i10) {
        return view.getTop();
    }

    @Override // com.bumptech.glide.h
    public final int n(View view) {
        this.f24929d.getClass();
        if (DrawerLayout.l(view)) {
            return view.getWidth();
        }
        return 0;
    }

    @Override // com.bumptech.glide.h
    public final void s(int i10, int i11) {
        int i12 = i10 & 1;
        DrawerLayout drawerLayout = this.f24929d;
        View viewD = i12 == 1 ? drawerLayout.d(3) : drawerLayout.d(5);
        if (viewD == null || drawerLayout.g(viewD) != 0) {
            return;
        }
        this.f24927b.c(i11, viewD);
    }

    @Override // com.bumptech.glide.h
    public final void t(int i10) {
        this.f24929d.postDelayed(this.f24928c, 160L);
    }

    @Override // com.bumptech.glide.h
    public final void u(View view, int i10) {
        ((e) view.getLayoutParams()).f24919c = false;
        int i11 = this.f24926a == 3 ? 5 : 3;
        DrawerLayout drawerLayout = this.f24929d;
        View viewD = drawerLayout.d(i11);
        if (viewD != null) {
            drawerLayout.b(viewD, true);
        }
    }

    @Override // com.bumptech.glide.h
    public final void v(int i10) {
        this.f24929d.r(i10, this.f24927b.getCapturedView());
    }

    @Override // com.bumptech.glide.h
    public final void w(View view, int i10, int i11) {
        int width = view.getWidth();
        DrawerLayout drawerLayout = this.f24929d;
        float width2 = (drawerLayout.a(3, view) ? i10 + width : drawerLayout.getWidth() - i10) / width;
        drawerLayout.o(width2, view);
        view.setVisibility(width2 == 0.0f ? 4 : 0);
        drawerLayout.invalidate();
    }

    @Override // com.bumptech.glide.h
    public final void x(float f10, float f11, View view) {
        int i10;
        DrawerLayout drawerLayout = this.f24929d;
        drawerLayout.getClass();
        float f12 = ((e) view.getLayoutParams()).f24918b;
        int width = view.getWidth();
        if (drawerLayout.a(3, view)) {
            i10 = (f10 > 0.0f || (f10 == 0.0f && f12 > 0.5f)) ? 0 : -width;
        } else {
            int width2 = drawerLayout.getWidth();
            if (f10 < 0.0f || (f10 == 0.0f && f12 > 0.5f)) {
                width2 -= width;
            }
            i10 = width2;
        }
        this.f24927b.q(i10, view.getTop());
        drawerLayout.invalidate();
    }
}
