package com.google.android.material.behavior;

import M.J;
import N.c;
import T.d;
import android.view.MotionEvent;
import android.view.View;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import d3.V0;
import java.lang.reflect.Field;
import k3.b;
import z.AbstractC1769a;

/* JADX INFO: loaded from: classes.dex */
public class SwipeDismissBehavior<V extends View> extends AbstractC1769a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public d f10107a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f10109c = 2;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public float f10110d = 0.0f;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public float f10111e = 0.5f;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final b f10112f = new b(this);

    @Override // z.AbstractC1769a
    public boolean f(CoordinatorLayout coordinatorLayout, View view, MotionEvent motionEvent) {
        boolean zO = this.f10108b;
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked == 0) {
            zO = coordinatorLayout.o(view, (int) motionEvent.getX(), (int) motionEvent.getY());
            this.f10108b = zO;
        } else if (actionMasked == 1 || actionMasked == 3) {
            this.f10108b = false;
        }
        if (!zO) {
            return false;
        }
        if (this.f10107a == null) {
            this.f10107a = new d(coordinatorLayout.getContext(), coordinatorLayout, this.f10112f);
        }
        return this.f10107a.p(motionEvent);
    }

    @Override // z.AbstractC1769a
    public final boolean g(CoordinatorLayout coordinatorLayout, View view, int i) {
        Field field = J.f4065a;
        if (view.getImportantForAccessibility() == 0) {
            view.setImportantForAccessibility(1);
            J.g(view, 1048576);
            J.e(view, 0);
            if (r(view)) {
                J.h(view, c.f4358j, new V0(23, this));
            }
        }
        return false;
    }

    @Override // z.AbstractC1769a
    public final boolean q(View view, MotionEvent motionEvent) {
        d dVar = this.f10107a;
        if (dVar == null) {
            return false;
        }
        dVar.j(motionEvent);
        return true;
    }

    public boolean r(View view) {
        return true;
    }
}
