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

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;

/* JADX INFO: loaded from: classes.dex */
public class ai extends ajl implements com.bytedance.sdk.component.adexpress.dynamic.lb {
    private boolean fm;

    public ai(Context context, DynamicRootView dynamicRootView, com.bytedance.sdk.component.adexpress.dynamic.yz.wu wuVar) {
        super(context, dynamicRootView, wuVar);
        this.wsy = this.wu;
        ImageView imageView = new ImageView(context);
        this.fhx = imageView;
        imageView.setTag(Integer.valueOf(getClickArea()));
        addView(this.fhx, getWidgetLayoutParams());
        dynamicRootView.setTimeOutListener(this);
        if (dynamicRootView.getRenderRequest() != null) {
            if (!dynamicRootView.getRenderRequest().nt()) {
                this.fhx.setVisibility(8);
                setVisibility(8);
            }
            this.fm = dynamicRootView.getRenderRequest().dsz();
        }
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.ajl, com.bytedance.sdk.component.adexpress.dynamic.dynamicview.pkk
    public boolean ef() {
        super.ef();
        View view = this.fhx;
        if (view != null) {
            ((ImageView) view).setScaleType(ImageView.ScaleType.CENTER_CROP);
            Drawable drawableFm = com.bytedance.sdk.component.adexpress.yz.lb.fm(getContext(), this.duv);
            if (drawableFm != null) {
                ((ImageView) this.fhx).setBackground(drawableFm);
            }
            Drawable drawableLb = this.fm ? com.bytedance.sdk.component.utils.maa.lb(getContext(), "tt_close_btn") : com.bytedance.sdk.component.utils.maa.lb(getContext(), "tt_skip_btn");
            if (drawableLb != null) {
                drawableLb.setAutoMirrored(true);
                ((ImageView) this.fhx).setImageDrawable(drawableLb);
            }
            int iFm = (int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ku, this.duv.ro());
            this.fhx.setPadding(iFm, iFm, iFm, iFm);
        }
        setVisibility(8);
        return true;
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.lb
    public void fm(CharSequence charSequence, boolean z10, int i10, boolean z11) {
        int i11 = 0;
        if (!z10 && !z11) {
            i11 = 8;
        }
        setVisibility(i11);
    }
}
