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

import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

/* JADX INFO: loaded from: classes.dex */
public class sds extends wsy implements com.bytedance.sdk.component.adexpress.dynamic.lb {
    private int[] fm;
    private int ro;
    private int wey;

    public sds(Context context, DynamicRootView dynamicRootView, com.bytedance.sdk.component.adexpress.dynamic.yz.wu wuVar) {
        super(context, dynamicRootView, wuVar);
        dynamicRootView.setTimeOutListener(this);
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.jnr
    public void ajl() {
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(this.wsy, this.wu);
        layoutParams.gravity = 8388629;
        layoutParams.setMarginStart(layoutParams.leftMargin);
        layoutParams.setMarginEnd(layoutParams.rightMargin);
        setLayoutParams(layoutParams);
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.wsy, com.bytedance.sdk.component.adexpress.dynamic.dynamicview.ajl, com.bytedance.sdk.component.adexpress.dynamic.dynamicview.pkk
    public boolean ef() {
        super.ef();
        ((TextView) this.fhx).setText("");
        return true;
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.lb
    @SuppressLint({"SetTextI18n"})
    public void fm(CharSequence charSequence, boolean z10, int i10, boolean z11) {
        String strFm = com.bytedance.sdk.component.utils.maa.fm(com.bytedance.sdk.component.adexpress.yz.fm(), "tt_reward_screen_skip_tx");
        if (i10 == 0) {
            this.fhx.setVisibility(0);
            ((TextView) this.fhx).setText("| ".concat(String.valueOf(strFm)));
            this.fhx.measure(-2, -2);
            this.fm = new int[]{this.fhx.getMeasuredWidth() + 1, this.fhx.getMeasuredHeight()};
            View view = this.fhx;
            int[] iArr = this.fm;
            view.setLayoutParams(new FrameLayout.LayoutParams(iArr[0], iArr[1]));
            ((TextView) this.fhx).setGravity(17);
            ((TextView) this.fhx).setIncludeFontPadding(false);
            fm();
            this.fhx.setPadding(this.duv.lb(), this.ro, this.duv.yz(), this.wey);
        }
        requestLayout();
    }

    @Override // android.widget.FrameLayout, android.view.View
    public void onMeasure(int i10, int i11) {
        super.onMeasure(i10, i11);
        if (TextUtils.isEmpty(((TextView) this.fhx).getText())) {
            setMeasuredDimension(0, this.wu);
        } else {
            setMeasuredDimension(this.wsy, this.wu);
        }
    }

    private void fm() {
        int iFm = (int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ku, this.duv.jnr());
        this.ro = ((this.wu - iFm) / 2) - this.duv.fm();
        this.wey = 0;
    }
}
