package com.lynx.tasm.ui.image;

import X.BZi;
import X.C3020QCz;
import X.C3178QJb;
import X.O44;
import X.QJU;
import X.QJV;
import X.QJW;
import X.QKP;
import X.QL3;
import X.QLS;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import com.bytedance.covode.number.Covode;
import com.lynx.tasm.base.LLog;
import java.lang.ref.WeakReference;

public class FrescoImageView$1 extends O44<BZi> {
    public final /* synthetic */ WeakReference LIZ;
    public final /* synthetic */ String LIZIZ;
    public final /* synthetic */ QL3 LIZJ;

    static {
        Covode.recordClassIndex(47028);
    }

    public final void LIZ(String str, Object obj) {
        LLog.LIZ(6, "FrescoImageView", "onFinalImageSet");
    }

    public final void LIZIZ(String str, Throwable th) {
        if (!this.LIZJ.retryWithRawSrc(this.LIZIZ)) {
            this.LIZJ.mIsDirty = true;
            if (this.LIZJ.mLoaderCallback != null) {
                this.LIZJ.mLoaderCallback.LIZ("Android FrescoImageView loading image failed, and the url is " + this.LIZJ.getSrc() + ". The Fresco throw error msg is " + th.getMessage());
            }
            LLog.LIZLLL("FrescoImageView", "onFailed src:" + this.LIZIZ + "with reason" + th.getMessage());
        }
    }

    public FrescoImageView$1(QL3 ql3, WeakReference weakReference, String str) {
        this.LIZJ = ql3;
        this.LIZ = weakReference;
        this.LIZIZ = str;
    }

    public final /* synthetic */ void LIZ(String str, Object obj, Animatable animatable) {
        C3020QCz qCz = (BZi) obj;
        if (this.LIZ.get() != null) {
            ((QL3) this.LIZ.get()).onImageRequestLoaded();
        }
        if (this.LIZJ.mDisableDefaultPlaceholder && (qCz instanceof C3020QCz)) {
            this.LIZJ.mTempPlaceHolder = qCz.cloneUnderlyingBitmapReference();
            QKP qkp = (QKP) this.LIZJ.getHierarchy();
            if (!(qkp == null || this.LIZJ.mTempPlaceHolder == null || this.LIZJ.mTempPlaceHolder.LIZ() == null)) {
                qkp.LIZ(1, (Drawable) new BitmapDrawable(this.LIZJ.getResources(), this.LIZJ.mTempPlaceHolder.LIZ()));
            }
        }
        if (QL3.sUrlImageSizeMap.containsKey(this.LIZJ.mImageSource.LIZ().toString())) {
            QLS qls = QL3.sUrlImageSizeMap.get(this.LIZJ.mImageSource.LIZ().toString());
            this.LIZJ.mSourceImageHeight = qls.LIZIZ;
            this.LIZJ.mSourceImageWidth = qls.LIZ;
        } else {
            this.LIZJ.mSourceImageWidth = qCz.getWidth();
            this.LIZJ.mSourceImageHeight = qCz.getHeight();
        }
        if (this.LIZJ.mLoaderCallback != null) {
            this.LIZJ.mLoaderCallback.LIZ(this.LIZJ.mSourceImageWidth, this.LIZJ.mSourceImageHeight);
        }
        if (animatable instanceof QJV) {
            QJV qjv = (QJV) animatable;
            qjv.LIZ((QJU) new C3178QJb(qjv.LIZLLL, this.LIZJ.getLoopCount()));
            QJW.LIZ(qjv);
        }
        LLog.LIZLLL("FrescoImageView", "onFinalImageSet");
    }
}
