package com.tencent.mm.plugin.sight.decode.ui;

import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.FrameLayout.LayoutParams;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.ab;

class SnsAdNativeLandingPagesVideoPlayerLoadingBar$1 implements OnTouchListener {
    final /* synthetic */ SnsAdNativeLandingPagesVideoPlayerLoadingBar qyV;

    SnsAdNativeLandingPagesVideoPlayerLoadingBar$1(SnsAdNativeLandingPagesVideoPlayerLoadingBar snsAdNativeLandingPagesVideoPlayerLoadingBar) {
        this.qyV = snsAdNativeLandingPagesVideoPlayerLoadingBar;
    }

    public final boolean onTouch(View view, MotionEvent motionEvent) {
        AppMethodBeat.i(70291);
        if (motionEvent.getAction() == 0) {
            ab.i("MicroMsg.SnsAdNativeLandingPagesVideoPlayerLoadingBar", "ontouch down");
            SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV, false);
            SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV, motionEvent.getX());
            if (SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV) != null) {
                SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV).aFw();
            }
        } else if (motionEvent.getAction() == 2) {
            float x = motionEvent.getX();
            LayoutParams layoutParams = (LayoutParams) SnsAdNativeLandingPagesVideoPlayerLoadingBar.b(this.qyV).getLayoutParams();
            layoutParams.leftMargin = SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV, ((int) (x - SnsAdNativeLandingPagesVideoPlayerLoadingBar.c(this.qyV))) + layoutParams.leftMargin);
            SnsAdNativeLandingPagesVideoPlayerLoadingBar.b(this.qyV).setLayoutParams(layoutParams);
            int d = SnsAdNativeLandingPagesVideoPlayerLoadingBar.d(this.qyV);
            if (SnsAdNativeLandingPagesVideoPlayerLoadingBar.e(this.qyV) > 0) {
                layoutParams = (LayoutParams) SnsAdNativeLandingPagesVideoPlayerLoadingBar.f(this.qyV).getLayoutParams();
                layoutParams.width = (int) (((((double) d) * 1.0d) / ((double) SnsAdNativeLandingPagesVideoPlayerLoadingBar.e(this.qyV))) * ((double) SnsAdNativeLandingPagesVideoPlayerLoadingBar.g(this.qyV)));
                SnsAdNativeLandingPagesVideoPlayerLoadingBar.f(this.qyV).setLayoutParams(layoutParams);
            }
            SnsAdNativeLandingPagesVideoPlayerLoadingBar.h(this.qyV).setText(SnsAdNativeLandingPagesVideoPlayerLoadingBar.oy(d / 60) + ":" + SnsAdNativeLandingPagesVideoPlayerLoadingBar.oy(d % 60));
            SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV, true);
        } else if (SnsAdNativeLandingPagesVideoPlayerLoadingBar.i(this.qyV)) {
            int d2 = SnsAdNativeLandingPagesVideoPlayerLoadingBar.d(this.qyV);
            if (SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV) != null) {
                ab.i("MicroMsg.SnsAdNativeLandingPagesVideoPlayerLoadingBar", "current time : ".concat(String.valueOf(d2)));
                SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV).oA(d2);
            }
            SnsAdNativeLandingPagesVideoPlayerLoadingBar.a(this.qyV, false);
        }
        AppMethodBeat.o(70291);
        return true;
    }
}
