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;
import androidx.annotation.NonNull;

/* JADX INFO: loaded from: classes.dex */
public class ef extends ajl {
    public ef(Context context, @NonNull DynamicRootView dynamicRootView, @NonNull com.bytedance.sdk.component.adexpress.dynamic.yz.wu wuVar) {
        super(context, dynamicRootView, wuVar);
        if (com.bytedance.sdk.component.adexpress.yz.ro()) {
            this.fhx = new ImageView(context);
        } else {
            this.fhx = new com.bytedance.sdk.component.adexpress.ajl.ef(context);
        }
        this.fhx.setTag(3);
        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()) {
            Drawable drawableFm = com.bytedance.sdk.component.adexpress.yz.lb.fm(getContext(), this.duv);
            if (drawableFm != null) {
                this.fhx.setBackground(drawableFm);
            }
            int iYz = com.bytedance.sdk.component.utils.maa.yz(getContext(), "tt_close_btn");
            if (iYz > 0) {
                ((ImageView) this.fhx).setImageResource(iYz);
            }
            ((ImageView) this.fhx).setScaleType(ImageView.ScaleType.FIT_XY);
            return true;
        }
        int iFm = (int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ku, this.duv.qhl());
        View view = this.fhx;
        if (view instanceof com.bytedance.sdk.component.adexpress.ajl.ef) {
            ((com.bytedance.sdk.component.adexpress.ajl.ef) view).setRadius((int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ku, this.duv.fhx()));
            ((com.bytedance.sdk.component.adexpress.ajl.ef) this.fhx).setStrokeWidth(iFm);
            ((com.bytedance.sdk.component.adexpress.ajl.ef) this.fhx).setStrokeColor(this.duv.irt());
            ((com.bytedance.sdk.component.adexpress.ajl.ef) this.fhx).setBgColor(this.duv.gzf());
            ((com.bytedance.sdk.component.adexpress.ajl.ef) this.fhx).setDislikeColor(this.duv.wsy());
            ((com.bytedance.sdk.component.adexpress.ajl.ef) this.fhx).setDislikeWidth((int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ku, 1.0f));
        }
        return true;
    }
}
