package com.google.android.material.behavior;

import a9.c;
import a9.d;
import a9.e;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.view.s1;
import androidx.media3.exoplayer.source.ProgressiveMediaSource;
import d0.b;
import y0.h;

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

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

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

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

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

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

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

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

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

    @Nullable
    @VisibleForTesting
    public e getListener() {
        return null;
    }

    @Override // d0.b
    public boolean k(CoordinatorLayout coordinatorLayout, View view, MotionEvent motionEvent) {
        boolean zM = this.f22250b;
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked == 0) {
            zM = coordinatorLayout.m(view, (int) motionEvent.getX(), (int) motionEvent.getY());
            this.f22250b = zM;
        } else if (actionMasked == 1 || actionMasked == 3) {
            this.f22250b = false;
        }
        if (!zM) {
            return false;
        }
        if (this.f22249a == null) {
            this.f22249a = new h(coordinatorLayout.getContext(), coordinatorLayout, this.f22256h);
        }
        return !this.f22251c && this.f22249a.r(motionEvent);
    }

    @Override // d0.b
    public final boolean l(CoordinatorLayout coordinatorLayout, View view, int i10) {
        if (view.getImportantForAccessibility() == 0) {
            view.setImportantForAccessibility(1);
            s1.g(ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES, view);
            s1.e(0, view);
            if (w(view)) {
                s1.replaceAccessibilityAction(view, q0.c.f32066l, null, new d(this));
            }
        }
        return false;
    }

    public void setListener(@Nullable e eVar) {
    }

    @Override // d0.b
    public final boolean v(CoordinatorLayout coordinatorLayout, View view, MotionEvent motionEvent) {
        if (this.f22249a == null) {
            return false;
        }
        if (this.f22251c && motionEvent.getActionMasked() == 3) {
            return true;
        }
        this.f22249a.k(motionEvent);
        return true;
    }

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