package com.tencent.mm.plugin.topstory.ui.video;

import android.content.Context;
import android.media.AudioManager;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.websearch.ui.a;

public final class k {
    int JB = 0;
    float hXK = 0.0f;
    private float iaA = 0.0f;
    int iaB = -1;
    int iaC = 0;
    Runnable iaD = new 1(this);
    View iaw;
    private GestureDetector iay;
    Context mContext;
    a sEC = a.sEH;
    c sED;
    boolean sEE;
    boolean sEF;

    public k(Context context, View view, c cVar) {
        AppMethodBeat.i(1739);
        this.mContext = context;
        this.sED = cVar;
        this.iaw = view;
        this.iay = new GestureDetector(this.mContext, new 2(this));
        this.hXK = a.cN(context);
        AppMethodBeat.o(1739);
    }

    public final void z(MotionEvent motionEvent) {
        AppMethodBeat.i(1740);
        if (this.sED.cGl()) {
            int actionMasked = motionEvent.getActionMasked();
            if (actionMasked == 0) {
                this.iaA = motionEvent.getRawX();
                this.JB = ((AudioManager) this.mContext.getSystemService("audio")).getStreamVolume(3);
                this.hXK = a.cN(this.mContext);
            }
            this.iay.onTouchEvent(motionEvent);
            if (actionMasked == 1 || actionMasked == 3) {
                if (this.sEC == a.sEK) {
                    c cVar = this.sED;
                    actionMasked = this.iaC;
                    motionEvent.getRawX();
                    cVar.FF(actionMasked);
                    this.iaB = -1;
                    this.iaC = 0;
                    this.iaA = 0.0f;
                } else if (this.sEC == a.sEI) {
                    ((AudioManager) this.mContext.getSystemService("audio")).getStreamMaxVolume(3);
                } else {
                    a aVar = a.sEJ;
                }
                this.sEC = a.sEH;
            }
            AppMethodBeat.o(1740);
            return;
        }
        this.sEC = a.sEH;
        AppMethodBeat.o(1740);
    }

    public final void aFY() {
        this.iaB = -1;
        this.iaC = 0;
        this.iaA = 0.0f;
    }
}
