package com.bytedance.sdk.component.adexpress.dynamic.dynamicview;

import android.content.Context;
import android.graphics.PorterDuff;
import android.text.TextUtils;
import android.widget.ImageView;

/* JADX INFO: loaded from: classes.dex */
public class onz extends ajl {
    public onz(Context context, DynamicRootView dynamicRootView, com.bytedance.sdk.component.adexpress.dynamic.yz.wu wuVar) {
        super(context, dynamicRootView, wuVar);
        ImageView imageView = new ImageView(context);
        this.fhx = imageView;
        imageView.setTag(Integer.valueOf(getClickArea()));
        if (com.bytedance.sdk.component.adexpress.yz.ro()) {
            this.wu = Math.max(dynamicRootView.getLogoUnionHeight(), this.wu);
        }
        addView(this.fhx, getWidgetLayoutParams());
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.ajl, com.bytedance.sdk.component.adexpress.dynamic.dynamicview.pkk
    public boolean ef() {
        super.ef();
        if (com.bytedance.sdk.component.adexpress.yz.ro()) {
            ((ImageView) this.fhx).setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        }
        DynamicRootView dynamicRootView = this.onz;
        if (dynamicRootView == null || dynamicRootView.getRenderRequest() == null || TextUtils.isEmpty(this.onz.getRenderRequest().mq())) {
            setVisibility(8);
        } else {
            String strMq = this.onz.getRenderRequest().mq();
            if (strMq.equals("logo")) {
                ((ImageView) this.fhx).setImageResource(com.bytedance.sdk.component.utils.maa.yz(getContext(), "tt_ad_logo"));
            } else {
                com.bytedance.sdk.component.jnr.vt vtVarJnr = com.bytedance.sdk.component.adexpress.fm.fm.fm.fm().jnr().fm(strMq).fm(this.wsy).ro(this.wu).yz(this.wsy).jnr(this.wu);
                String strOnz = this.onz.getRenderRequest().onz();
                if (!TextUtils.isEmpty(strOnz)) {
                    vtVarJnr.ro(strOnz);
                }
                vtVarJnr.fm((ImageView) this.fhx);
            }
        }
        ((ImageView) this.fhx).setColorFilter(this.duv.wsy(), PorterDuff.Mode.SRC_IN);
        return true;
    }
}
