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 yz implements View.OnTouchListener {
    private float ajl;

    /* JADX INFO: renamed from: ef, reason: collision with root package name */
    private com.bytedance.sdk.component.adexpress.dynamic.lb.wu f6498ef;
    private float fm;
    private boolean jnr = true;
    private boolean ku;

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

    public yz(com.bytedance.sdk.component.adexpress.dynamic.lb.wu wuVar, int i10, boolean z10) {
        this.f6498ef = wuVar;
        this.vt = i10;
        this.ku = z10;
    }

    @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;
        int action = motionEvent.getAction();
        if (action == 0) {
            this.fm = motionEvent.getX();
            this.ro = motionEvent.getY();
            this.ajl = motionEvent.getY();
            this.jnr = true;
        } else if (action != 1) {
            if (action == 2) {
                float y10 = motionEvent.getY();
                this.wsy = y10;
                if (Math.abs(y10 - this.ajl) > 10.0f) {
                    this.wu = true;
                }
                this.yz = motionEvent.getX();
                this.f6499lb = motionEvent.getY();
                if (Math.abs(this.yz - this.fm) > 8.0f || Math.abs(this.f6499lb - this.ro) > 8.0f) {
                    this.jnr = false;
                }
            }
        } else {
            if (!this.wu && !this.jnr) {
                return false;
            }
            if (this.ku || (wuVar3 = this.f6498ef) == null) {
                int iRo = com.bytedance.sdk.component.adexpress.yz.wsy.ro(com.bytedance.sdk.component.adexpress.yz.fm(), Math.abs(this.wsy - this.ajl));
                if (this.wsy - this.ajl < 0.0f && iRo > this.vt && (wuVar2 = this.f6498ef) != null) {
                    wuVar2.fm();
                } else if (this.jnr && (wuVar = this.f6498ef) != null) {
                    wuVar.fm();
                }
            } else {
                wuVar3.fm();
            }
        }
        return true;
    }
}
