package com.tencent.mm.plugin.sns.storage.AdLandingPagesStorage.AdLandingPageComponent.component.widget;

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.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import java.lang.ref.WeakReference;

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

    /* Access modifiers changed, original: protected|final */
    public final int ckZ() {
        return 2131034257;
    }

    public AdlandingSightPlayImageView$a(AdlandingSightPlayImageView adlandingSightPlayImageView) {
        super(adlandingSightPlayImageView);
        AppMethodBeat.i(37436);
        this.qyB = new WeakReference(adlandingSightPlayImageView);
        AppMethodBeat.o(37436);
    }

    public final void dH(int i, int i2) {
        AppMethodBeat.i(37437);
        AdlandingSightPlayImageView adlandingSightPlayImageView = (AdlandingSightPlayImageView) this.qyB.get();
        if (adlandingSightPlayImageView == null) {
            ab.e("MicroMsg.SightPlayImageView", "onGetVideoSizeEnd, imageView is null, do clear");
            clear();
            AppMethodBeat.o(37437);
        } else if (AdlandingSightPlayImageView.a(adlandingSightPlayImageView)) {
            AppMethodBeat.o(37437);
        } else {
            AdlandingSightPlayImageView.a(adlandingSightPlayImageView, i);
            AdlandingSightPlayImageView.b(adlandingSightPlayImageView, i2);
            if (adlandingSightPlayImageView.llE != null) {
                adlandingSightPlayImageView.llE.dH(i, i2);
            }
            if (AdlandingSightPlayImageView.b(adlandingSightPlayImageView)) {
                if (AdlandingSightPlayImageView.c(adlandingSightPlayImageView) >= AdlandingSightPlayImageView.d(adlandingSightPlayImageView)) {
                    AdlandingSightPlayImageView.c(adlandingSightPlayImageView, a.fromDPToPix(adlandingSightPlayImageView.getContext(), 150));
                } else {
                    AdlandingSightPlayImageView.c(adlandingSightPlayImageView, a.fromDPToPix(adlandingSightPlayImageView.getContext(), 85));
                }
            }
            if (AdlandingSightPlayImageView.e(adlandingSightPlayImageView) > 0) {
                LayoutParams layoutParams = adlandingSightPlayImageView.getLayoutParams();
                if (!(layoutParams.width == AdlandingSightPlayImageView.e(adlandingSightPlayImageView) && layoutParams.height == (AdlandingSightPlayImageView.e(adlandingSightPlayImageView) * i2) / i)) {
                    layoutParams.width = AdlandingSightPlayImageView.e(adlandingSightPlayImageView);
                    layoutParams.height = (AdlandingSightPlayImageView.e(adlandingSightPlayImageView) * i2) / i;
                    al.d(new 1(this, adlandingSightPlayImageView, layoutParams));
                    adlandingSightPlayImageView.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(AdlandingSightPlayImageView.e(adlandingSightPlayImageView)), Integer.valueOf(i), Integer.valueOf(i2)});
            AppMethodBeat.o(37437);
        }
    }

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