package o;

import android.os.Handler;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Checkable;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class TL implements View.OnTouchListener {
    public final /* synthetic */ int l;
    public final /* synthetic */ Object m;

    public /* synthetic */ TL(int i, Object obj) {
        this.l = i;
        this.m = obj;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // android.view.View.OnTouchListener
    public final boolean onTouch(View view, MotionEvent motionEvent) {
        switch (this.l) {
            case 0:
                UL ul = (UL) this.m;
                QL ql = ul.C;
                Handler handler = ul.G;
                C0979d8 c0979d8 = ul.K;
                int action = motionEvent.getAction();
                int x = (int) motionEvent.getX();
                int y = (int) motionEvent.getY();
                if (action == 0 && c0979d8 != null && c0979d8.isShowing() && x >= 0 && x < c0979d8.getWidth() && y >= 0 && y < c0979d8.getHeight()) {
                    handler.postDelayed(ql, 250L);
                    return false;
                }
                if (action != 1) {
                    return false;
                }
                handler.removeCallbacks(ql);
                return false;
            default:
                if (((Checkable) view).isChecked()) {
                    return ((GestureDetector) this.m).onTouchEvent(motionEvent);
                }
                return false;
        }
    }
}
