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

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

/* JADX INFO: loaded from: classes.dex */
public class irt extends ajl implements com.bytedance.sdk.component.adexpress.dynamic.ro {
    public irt(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(5);
        addView(this.fhx, getWidgetLayoutParams());
        dynamicRootView.setMuteListener(this);
        if (dynamicRootView.getRenderRequest() == null || dynamicRootView.getRenderRequest().nt()) {
            return;
        }
        this.fhx.setVisibility(8);
        setVisibility(8);
    }

    @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.FIT_CENTER);
        } else {
            ((ImageView) this.fhx).setScaleType(ImageView.ScaleType.CENTER);
        }
        setSoundMute(this.onz.mIsMute);
        if (!com.bytedance.sdk.component.adexpress.yz.ro()) {
            ((ImageView) this.fhx).setBackgroundDrawable(com.bytedance.sdk.component.adexpress.yz.wu.fm(0, Integer.valueOf(this.duv.gzf()), new int[]{this.wu / 2}, null, null, null));
            return true;
        }
        Drawable drawableFm = com.bytedance.sdk.component.adexpress.yz.lb.fm(getContext(), this.duv);
        if (drawableFm == null) {
            return true;
        }
        ((ImageView) this.fhx).setBackground(drawableFm);
        return true;
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.jnr
    public boolean jnr() {
        return true;
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.ro
    public void setSoundMute(boolean z10) {
        ((ImageView) this.fhx).setImageResource(z10 ? com.bytedance.sdk.component.utils.maa.yz(getContext(), "tt_reward_full_mute") : com.bytedance.sdk.component.utils.maa.yz(getContext(), "tt_reward_full_unmute"));
        if (((ImageView) this.fhx).getDrawable() != null) {
            ((ImageView) this.fhx).getDrawable().setAutoMirrored(true);
        }
    }
}
