package p032k0;

import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.EdgeEffect;

/* renamed from: k0.l */
/* loaded from: classes.dex */
public final class C1313l {

    /* renamed from: k0.l$a */
    /* loaded from: classes.dex */
    public static class C1314a {
        /* renamed from: a */
        public static void m1630a(EdgeEffect edgeEffect, float f, float f2) {
            edgeEffect.onPull(f, f2);
        }
    }

    /* renamed from: k0.l$b */
    /* loaded from: classes.dex */
    public static class C1315b {
        /* renamed from: a */
        public static EdgeEffect m1629a(Context context, AttributeSet attributeSet) {
            try {
                return new EdgeEffect(context, attributeSet);
            } catch (Throwable unused) {
                return new EdgeEffect(context);
            }
        }

        /* renamed from: b */
        public static float m1628b(EdgeEffect edgeEffect) {
            float distance;
            try {
                distance = edgeEffect.getDistance();
                return distance;
            } catch (Throwable unused) {
                return 0.0f;
            }
        }

        /* renamed from: c */
        public static float m1627c(EdgeEffect edgeEffect, float f, float f2) {
            float onPullDistance;
            try {
                onPullDistance = edgeEffect.onPullDistance(f, f2);
                return onPullDistance;
            } catch (Throwable unused) {
                edgeEffect.onPull(f, f2);
                return 0.0f;
            }
        }
    }

    /* renamed from: a */
    public static EdgeEffect m1634a(Context context, AttributeSet attributeSet) {
        return Build.VERSION.SDK_INT >= 31 ? C1315b.m1629a(context, attributeSet) : new EdgeEffect(context);
    }

    /* renamed from: b */
    public static float m1633b(EdgeEffect edgeEffect) {
        if (Build.VERSION.SDK_INT >= 31) {
            return C1315b.m1628b(edgeEffect);
        }
        return 0.0f;
    }

    /* renamed from: c */
    public static void m1632c(EdgeEffect edgeEffect, float f, float f2) {
        if (Build.VERSION.SDK_INT >= 21) {
            C1314a.m1630a(edgeEffect, f, f2);
        } else {
            edgeEffect.onPull(f);
        }
    }

    /* renamed from: d */
    public static float m1631d(EdgeEffect edgeEffect, float f, float f2) {
        if (Build.VERSION.SDK_INT >= 31) {
            return C1315b.m1627c(edgeEffect, f, f2);
        }
        m1632c(edgeEffect, f, f2);
        return f;
    }
}