package com.lynx.tasm.ui.image;

import X.C3277QMw;
import X.C4065QhC;
import X.C4398QmZ;
import X.C4502QoF;
import X.QHV;
import X.QL2;
import X.QLQ;
import X.QNL;
import X.QNX;
import X.QWT;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.lynx.tasm.base.LLog;
import com.lynx.tasm.behavior.ui.UIBody;
import com.lynx.tasm.utils.ColorUtils;

public class UIFilterImage extends UIImage<QL2> {
    static {
        Covode.recordClassIndex(47038);
    }

    public void onLayoutUpdated() {
        super.onLayoutUpdated();
        ((QL2) this.mView).markShadowDirty();
    }

    public UIFilterImage(C4398QmZ qmZ) {
        super(qmZ);
    }

    /* access modifiers changed from: private */
    /* renamed from: LIZIZ */
    public QL2 createView(Context context) {
        this.LIZ = QHV.LIZIZ();
        QL2 ql2 = new QL2(context, this.LIZ, (GlobalImageLoadListener) null, (Object) null);
        ql2.setImageLoaderCallback(new QLQ() {
            static {
                Covode.recordClassIndex(47041);
            }

            public final void LIZ(String str) {
                QWT qwt = new QWT(UIFilterImage.this.getSign(), "error");
                qwt.LIZ("errMsg", str);
                UIFilterImage.this.mContext.LJFF.LIZ((C4502QoF) qwt);
                UIFilterImage.this.mContext.LJFF.LIZ(new C3277QMw(UIFilterImage.this.getSign()));
            }

            public final void LIZ(int i, int i2) {
                if (UIFilterImage.this.mEvents != null && UIFilterImage.this.mEvents.containsKey("load")) {
                    QWT qwt = new QWT(UIFilterImage.this.getSign(), "load");
                    qwt.LIZ(C4065QhC.LJFF, Integer.valueOf(i2));
                    qwt.LIZ("width", Integer.valueOf(i));
                    UIFilterImage.this.mContext.LJFF.LIZ((C4502QoF) qwt);
                }
            }
        });
        return ql2;
    }

    @QNL(LIZ = "drop-shadow")
    public void setDropShadow(String str) {
        if (str == null) {
            ((QL2) this.mView).setShadowOffsetX(0);
            ((QL2) this.mView).setShadowOffsetY(0);
            ((QL2) this.mView).setShadowColor(0);
            ((QL2) this.mView).setShadowRadius(0);
            return;
        }
        String[] split = str.split(" +");
        try {
            if (split.length == 4) {
                UIBody uIBody = this.mContext.LJIIIIZZ;
                ((QL2) this.mView).setShadowOffsetX(Math.round(QNX.LIZ(split[0], uIBody.mFontSize, this.mFontSize, (float) uIBody.getWidth(), (float) uIBody.getHeight(), 0.0f, this.mContext.LJIILIIL)));
                ((QL2) this.mView).setShadowOffsetY(Math.round(QNX.LIZ(split[1], uIBody.mFontSize, this.mFontSize, (float) uIBody.getWidth(), (float) uIBody.getHeight(), 0.0f, this.mContext.LJIILIIL)));
                ((QL2) this.mView).setShadowRadius(Math.round(QNX.LIZ(split[2], uIBody.mFontSize, this.mFontSize, (float) uIBody.getWidth(), (float) uIBody.getHeight(), 0.0f, this.mContext.LJIILIIL)));
                ((QL2) this.mView).setShadowColor(ColorUtils.LIZ(split[3]));
                return;
            }
        } catch (Exception unused) {
            if (1 == 0) {
                return;
            }
        }
        LLog.LIZ(5, "UIShadowImage", "Parse error for drop-shadow!");
    }
}
