package com.bytedance.adsdk.ugeno.core.ro;

import android.content.Context;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import com.bytedance.adsdk.ugeno.core.dsz;
import com.bytedance.adsdk.ugeno.core.fhx;

/* JADX INFO: loaded from: classes.dex */
public class lb {
    private final int ajl;
    private float fm;
    private boolean jnr;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private dsz f6321lb;
    private float ro;
    private Context yz;

    public lb(Context context, dsz dszVar) {
        this.yz = context;
        this.f6321lb = dszVar;
        this.ajl = ViewConfiguration.get(context).getScaledTouchSlop();
    }

    public boolean fm(fhx fhxVar, com.bytedance.adsdk.ugeno.ro.lb lbVar, MotionEvent motionEvent) {
        int action = motionEvent.getAction();
        if (action == 0) {
            this.fm = motionEvent.getX();
            this.ro = motionEvent.getY();
        } else if (action != 1) {
            if (action == 2) {
                float x10 = motionEvent.getX();
                float y10 = motionEvent.getY();
                if (Math.abs(x10 - this.fm) >= this.ajl || Math.abs(y10 - this.ro) >= this.ajl) {
                    this.jnr = true;
                }
            } else if (action == 3) {
                this.jnr = false;
            }
        } else {
            if (this.jnr) {
                this.jnr = false;
                return false;
            }
            float x11 = motionEvent.getX();
            float y11 = motionEvent.getY();
            if (Math.abs(x11 - this.fm) >= this.ajl || Math.abs(y11 - this.ro) >= this.ajl) {
                this.jnr = false;
            } else if (fhxVar != null) {
                fhxVar.fm(this.f6321lb, lbVar, lbVar);
                return true;
            }
        }
        return true;
    }
}
