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

import android.content.Context;
import android.text.TextUtils;
import android.widget.FrameLayout;
import android.widget.TextView;

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

    private boolean fm() {
        if (com.bytedance.sdk.component.adexpress.yz.ro()) {
            return false;
        }
        return (!TextUtils.isEmpty(this.duv.ro) && this.duv.ro.contains("adx:")) || com.bytedance.sdk.component.adexpress.dynamic.jnr.ku.ro();
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.jnr
    public void ajl() {
        com.bytedance.sdk.component.adexpress.ro.dsz renderRequest = this.onz.getRenderRequest();
        if (renderRequest == null || !TextUtils.isEmpty(renderRequest.mq())) {
            super.ajl();
            return;
        }
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(this.wsy, this.wu);
        layoutParams.gravity = 17;
        setLayoutParams(layoutParams);
    }

    /* JADX WARN: Removed duplicated region for block: B:11:0x0080  */
    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.ajl, com.bytedance.sdk.component.adexpress.dynamic.dynamicview.pkk
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public boolean ef() {
        com.bytedance.sdk.component.adexpress.ro.dsz renderRequest;
        super.ef();
        this.fhx.setTextAlignment(this.duv.wu());
        ((TextView) this.fhx).setTextColor(this.duv.wsy());
        ((TextView) this.fhx).setTextSize(this.duv.jnr());
        if (!com.bytedance.sdk.component.adexpress.yz.ro()) {
            if (!fm()) {
                ((TextView) this.fhx).setText(com.bytedance.sdk.component.utils.maa.ro(getContext(), "tt_logo_cn"));
                return true;
            }
            if (com.bytedance.sdk.component.adexpress.dynamic.jnr.ku.ro()) {
                ((TextView) this.fhx).setText(com.bytedance.sdk.component.adexpress.dynamic.jnr.ku.fm());
                return true;
            }
            ((TextView) this.fhx).setText(com.bytedance.sdk.component.adexpress.dynamic.jnr.ku.fm(this.duv.ro));
            return true;
        }
        int i10 = 0;
        ((TextView) this.fhx).setIncludeFontPadding(false);
        ((TextView) this.fhx).setTextSize(Math.min(((com.bytedance.sdk.component.adexpress.yz.wsy.ro(com.bytedance.sdk.component.adexpress.yz.fm(), this.wu) - this.duv.ro()) - this.duv.fm()) - 0.5f, this.duv.jnr()));
        DynamicRootView dynamicRootView = this.onz;
        if (dynamicRootView == null || (renderRequest = dynamicRootView.getRenderRequest()) == null) {
            i10 = 8;
        } else {
            String strGzf = renderRequest.gzf();
            if (!TextUtils.isEmpty(strGzf)) {
                ((TextView) this.fhx).setText(strGzf);
            }
        }
        ((TextView) this.fhx).setVisibility(i10);
        return true;
    }
}
