package com.bytedance.sdk.openadsdk.core.dsz.ro;

import android.content.Context;
import android.text.TextUtils;

/* JADX INFO: loaded from: classes2.dex */
public class ro extends com.bytedance.adsdk.ugeno.ef.ajl.ro {
    private String po;
    private String ucr;

    public ro(Context context) {
        super(context);
    }

    @Override // com.bytedance.adsdk.ugeno.ef.ajl.ro, com.bytedance.adsdk.ugeno.ro.lb
    public void fm(String str, String str2) {
        super.fm(str, str2);
        str.getClass();
        if (str.equals("before")) {
            this.ucr = str2;
        } else if (str.equals("after")) {
            this.po = str2;
        }
    }

    @Override // com.bytedance.adsdk.ugeno.ef.ajl.ro
    public void onz(String str) {
        if (TextUtils.isEmpty(str) || TextUtils.equals(str, "null")) {
            str = "";
        }
        if (TextUtils.isEmpty(this.po) || TextUtils.equals(this.po, "null")) {
            this.po = "";
        }
        if (TextUtils.isEmpty(this.ucr) || TextUtils.equals(this.ucr, "null")) {
            this.ucr = "";
        }
        String str2 = this.ucr + str + this.po;
        ((com.bytedance.adsdk.ugeno.ef.ajl.ro) this).fm = str2;
        ((com.bytedance.adsdk.ugeno.ef.ajl.fm) this.jnr).setText(str2);
        try {
            float f10 = this.f6377ha ? this.mq : this.nt;
            float f11 = this.pkk ? this.gzf : this.nt;
            float fMeasureText = ((com.bytedance.adsdk.ugeno.ef.ajl.fm) this.jnr).getPaint().measureText(((com.bytedance.adsdk.ugeno.ef.ajl.ro) this).fm);
            if (fMeasureText >= 0.0f) {
                jnr((int) (f10 + fMeasureText + f11));
            }
        } catch (Throwable unused) {
        }
    }

    @Override // com.bytedance.adsdk.ugeno.ef.ajl.ro, com.bytedance.adsdk.ugeno.ro.lb
    public void ro() {
        super.ro();
        if (TextUtils.isEmpty(this.po) || TextUtils.equals(this.po, "null")) {
            this.po = "";
        }
        if (TextUtils.isEmpty(this.ucr) || TextUtils.equals(this.ucr, "null")) {
            this.ucr = "";
        }
        String str = this.ucr + this.po;
        ((com.bytedance.adsdk.ugeno.ef.ajl.ro) this).fm = str;
        ((com.bytedance.adsdk.ugeno.ef.ajl.fm) this.jnr).setText(str);
        ((com.bytedance.adsdk.ugeno.ef.ajl.fm) this.jnr).setGravity(17);
    }

    public int yz() {
        return this.ywr;
    }
}
