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

import android.graphics.Bitmap;
import android.view.ViewGroup.LayoutParams;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.bz.a;
import com.tencent.mm.plugin.sight.decode.a.b;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import java.lang.ref.WeakReference;

final class SightPlayImageView$a extends b {
    private WeakReference<SightPlayImageView> qyB;

    public final int ckZ() {
        return 2131034257;
    }

    public SightPlayImageView$a(SightPlayImageView sightPlayImageView) {
        super(0, sightPlayImageView);
        AppMethodBeat.i(70253);
        this.qyB = new WeakReference(sightPlayImageView);
        AppMethodBeat.o(70253);
    }

    public final void dH(int i, int i2) {
        AppMethodBeat.i(70254);
        SightPlayImageView sightPlayImageView = (SightPlayImageView) this.qyB.get();
        if (sightPlayImageView == null) {
            ab.e("MicroMsg.SightPlayImageView", "onGetVideoSizeEnd, imageView is null, do clear");
            clear();
            AppMethodBeat.o(70254);
        } else if (SightPlayImageView.a(sightPlayImageView)) {
            AppMethodBeat.o(70254);
        } else {
            SightPlayImageView.a(sightPlayImageView, i);
            SightPlayImageView.b(sightPlayImageView, i2);
            if (sightPlayImageView.llE != null) {
                sightPlayImageView.llE.dH(i, i2);
            }
            if (SightPlayImageView.b(sightPlayImageView)) {
                if (SightPlayImageView.c(sightPlayImageView) >= SightPlayImageView.d(sightPlayImageView)) {
                    SightPlayImageView.c(sightPlayImageView, a.fromDPToPix(sightPlayImageView.getContext(), 150));
                } else {
                    SightPlayImageView.c(sightPlayImageView, a.fromDPToPix(sightPlayImageView.getContext(), 85));
                }
            }
            if (SightPlayImageView.e(sightPlayImageView) > 0) {
                LayoutParams layoutParams = sightPlayImageView.getLayoutParams();
                if (!(layoutParams.width == SightPlayImageView.e(sightPlayImageView) && layoutParams.height == (SightPlayImageView.e(sightPlayImageView) * i2) / i)) {
                    layoutParams.width = SightPlayImageView.e(sightPlayImageView);
                    layoutParams.height = (SightPlayImageView.e(sightPlayImageView) * i2) / i;
                    al.d(new 1(this, sightPlayImageView, layoutParams));
                    sightPlayImageView.postInvalidate();
                }
                ab.i("MicroMsg.SightPlayImageView", "onGetVideoSize::params width %d height %d", new Object[]{Integer.valueOf(layoutParams.width), Integer.valueOf(layoutParams.height)});
            }
            ab.i("MicroMsg.SightPlayImageView", "onGetVideoSize::DrawWidth %d, video size %d*%d", new Object[]{Integer.valueOf(SightPlayImageView.e(sightPlayImageView)), Integer.valueOf(i), Integer.valueOf(i2)});
            AppMethodBeat.o(70254);
        }
    }

    public final void U(Bitmap bitmap) {
        AppMethodBeat.i(70255);
        SightPlayImageView sightPlayImageView = (SightPlayImageView) this.qyB.get();
        if (sightPlayImageView == null) {
            ab.e("MicroMsg.SightPlayImageView", "onGetFrameBmp, imageView is null, do clear");
            clear();
            AppMethodBeat.o(70255);
            return;
        }
        sightPlayImageView.setImageBitmap(bitmap);
        AppMethodBeat.o(70255);
    }
}
