package com.bytedance.sdk.component.adexpress.dynamic.lb.fm;

import android.view.MotionEvent;
import android.view.View;

/* JADX INFO: loaded from: classes.dex */
public class lb implements View.OnTouchListener {
    private com.bytedance.sdk.component.adexpress.dynamic.lb.wu ajl;

    /* JADX INFO: renamed from: ef, reason: collision with root package name */
    private boolean f6492ef;
    private float fm;
    private boolean jnr;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private float f6493lb;
    private float ro;
    private int wsy;
    private boolean wu;
    private float yz;

    public lb(com.bytedance.sdk.component.adexpress.dynamic.lb.wu wuVar) {
        this(wuVar, 5);
    }

    @Override // android.view.View.OnTouchListener
    public boolean onTouch(View view, MotionEvent motionEvent) {
        com.bytedance.sdk.component.adexpress.dynamic.lb.wu wuVar;
        com.bytedance.sdk.component.adexpress.dynamic.lb.wu wuVar2;
        com.bytedance.sdk.component.adexpress.dynamic.lb.wu wuVar3;
        if (this.f6492ef) {
            return true;
        }
        int action = motionEvent.getAction();
        if (action == 0) {
            this.fm = motionEvent.getX();
            this.ro = motionEvent.getY();
        } else if (action != 1) {
            if (action == 2) {
                this.yz = motionEvent.getX();
                this.f6493lb = motionEvent.getY();
                if (Math.abs(this.yz - this.fm) > 10.0f) {
                    this.jnr = true;
                }
                if (Math.abs(this.yz - this.fm) > 8.0f || Math.abs(this.f6493lb - this.ro) > 8.0f) {
                    this.wu = false;
                }
                int iRo = com.bytedance.sdk.component.adexpress.yz.wsy.ro(com.bytedance.sdk.component.adexpress.yz.fm(), Math.abs(this.yz - this.fm));
                if (this.yz > this.fm && iRo > this.wsy && (wuVar3 = this.ajl) != null) {
                    wuVar3.fm();
                    this.f6492ef = true;
                }
            }
        } else {
            if (!this.jnr && !this.wu) {
                return false;
            }
            float x10 = motionEvent.getX();
            float y10 = motionEvent.getY();
            int iRo2 = com.bytedance.sdk.component.adexpress.yz.wsy.ro(com.bytedance.sdk.component.adexpress.yz.fm(), Math.abs(this.yz - this.fm));
            if (this.yz > this.fm && iRo2 > this.wsy && (wuVar2 = this.ajl) != null) {
                wuVar2.fm();
                this.f6492ef = true;
            }
            float fAbs = Math.abs(x10 - this.fm);
            float fAbs2 = Math.abs(y10 - this.ro);
            if ((fAbs < 8.0f || fAbs2 < 8.0f) && (wuVar = this.ajl) != null) {
                wuVar.ro();
                this.f6492ef = true;
            }
        }
        return true;
    }

    public lb(com.bytedance.sdk.component.adexpress.dynamic.lb.wu wuVar, int i10) {
        this.wsy = 5;
        this.wu = true;
        this.ajl = wuVar;
        if (i10 > 0) {
            this.wsy = i10;
        }
    }
}
