package com.tencent.mm.modelappbrand.a;

import android.graphics.Bitmap;
import android.widget.ImageView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import java.lang.ref.WeakReference;

class b$k implements b$i {
    private final WeakReference<ImageView> aIp;
    private final b fqu;
    boolean fqv;
    final String key;

    /* synthetic */ b$k(ImageView imageView, b bVar, byte b) {
        this(imageView, bVar);
    }

    /* Access modifiers changed, original: final */
    public final ImageView getImageView() {
        AppMethodBeat.i(77340);
        ImageView imageView = (ImageView) this.aIp.get();
        AppMethodBeat.o(77340);
        return imageView;
    }

    private b$k(ImageView imageView, b bVar) {
        AppMethodBeat.i(77341);
        this.fqv = false;
        this.aIp = new WeakReference(imageView);
        this.fqu = bVar;
        this.key = "ImageView#" + imageView.hashCode();
        AppMethodBeat.o(77341);
    }

    private void abX() {
        AppMethodBeat.i(77342);
        if (this.aIp.get() != null) {
            b.c(this.fqu).remove(Integer.valueOf(((ImageView) this.aIp.get()).hashCode()));
        }
        AppMethodBeat.o(77342);
    }

    public void abU() {
    }

    public final void x(Bitmap bitmap) {
        AppMethodBeat.i(77343);
        abX();
        ImageView imageView = (ImageView) this.aIp.get();
        if (imageView != null) {
            if (!al.isMainThread()) {
                ab.b("MicroMsg.AppBrandSimpleImageLoader", "onBitmapLoaded invoke in non-main thread!!!", new Object[0]);
            }
            imageView.setImageDrawable(new e(imageView.getResources(), bitmap));
        }
        this.fqv = true;
        AppMethodBeat.o(77343);
    }

    public final void mr() {
        AppMethodBeat.i(77344);
        abX();
        AppMethodBeat.o(77344);
    }

    public final String wP() {
        return this.key;
    }
}
