package com.bytedance.sdk.component.adexpress.dynamic.tN.YFl;

import android.view.MotionEvent;
import android.view.View;
/* loaded from: classes2.dex */
public class vc implements View.OnTouchListener {
    private static int tN = 10;
    private boolean AlY;
    private float Sg;
    private float YFl;
    private com.bytedance.sdk.component.adexpress.dynamic.tN.qsH wN;

    public vc(com.bytedance.sdk.component.adexpress.dynamic.tN.qsH qsh) {
        this.wN = qsh;
    }

    @Override // android.view.View.OnTouchListener
    public boolean onTouch(View view, MotionEvent motionEvent) {
        int action = motionEvent.getAction();
        if (action == 0) {
            this.YFl = motionEvent.getX();
            this.Sg = motionEvent.getY();
        } else if (action != 1) {
            if (action == 2) {
                float x = motionEvent.getX();
                float y = motionEvent.getY();
                if (Math.abs(x - this.YFl) >= tN || Math.abs(y - this.Sg) >= tN) {
                    this.AlY = true;
                }
            } else if (action == 3) {
                this.AlY = false;
            }
        } else if (this.AlY) {
            this.AlY = false;
            return false;
        } else {
            float x2 = motionEvent.getX();
            float y2 = motionEvent.getY();
            if (Math.abs(x2 - this.YFl) >= tN || Math.abs(y2 - this.Sg) >= tN) {
                this.AlY = false;
            } else {
                com.bytedance.sdk.component.adexpress.dynamic.tN.qsH qsh = this.wN;
                if (qsh != null) {
                    qsh.YFl();
                }
            }
        }
        return true;
    }
}
