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

import android.content.Context;
import android.widget.FrameLayout;

/* JADX INFO: loaded from: classes.dex */
public class hlt extends ajl {
    private int fm;

    public hlt(Context context, DynamicRootView dynamicRootView, com.bytedance.sdk.component.adexpress.dynamic.yz.wu wuVar) {
        super(context, dynamicRootView, wuVar);
        this.fm = 0;
        com.bytedance.sdk.component.adexpress.ajl.lse lseVar = new com.bytedance.sdk.component.adexpress.ajl.lse(context, null);
        this.fhx = lseVar;
        lseVar.setTag(Integer.valueOf(getClickArea()));
        addView(this.fhx, getWidgetLayoutParams());
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.jnr
    public void ajl() {
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(this.wsy, this.wu);
        layoutParams.topMargin = this.vt;
        int i10 = this.f6471ef + this.fm;
        layoutParams.leftMargin = i10;
        layoutParams.setMarginStart(i10);
        layoutParams.setMarginEnd(layoutParams.rightMargin);
        setLayoutParams(layoutParams);
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.ajl, com.bytedance.sdk.component.adexpress.dynamic.dynamicview.pkk
    public boolean ef() {
        DynamicRootView dynamicRootView;
        super.ef();
        double dDsz = this.duv.dsz();
        if (com.bytedance.sdk.component.adexpress.yz.ro() && (dDsz < 0.0d || dDsz > 5.0d || ((dynamicRootView = this.onz) != null && dynamicRootView.getRenderRequest() != null && this.onz.getRenderRequest().vt() != 4))) {
            this.fhx.setVisibility(8);
            return true;
        }
        double d10 = (dDsz < 0.0d || dDsz > 5.0d) ? 5.0d : dDsz;
        this.fhx.setVisibility(0);
        ((com.bytedance.sdk.component.adexpress.ajl.lse) this.fhx).fm(d10, this.duv.wsy(), (int) this.duv.jnr(), ((int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ku, this.duv.ro())) + ((int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ku, this.duv.fm())) + ((int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ku, this.duv.jnr())));
        return true;
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.dynamicview.ajl
    public FrameLayout.LayoutParams getWidgetLayoutParams() {
        int iFm = (int) (com.bytedance.sdk.component.adexpress.yz.wsy.fm(com.bytedance.sdk.component.adexpress.yz.fm(), com.bytedance.sdk.component.adexpress.yz.wsy.fm(com.bytedance.sdk.component.adexpress.yz.fm(), this.duv.yz()) + this.duv.lb()) + (com.bytedance.sdk.component.adexpress.yz.wsy.fm(com.bytedance.sdk.component.adexpress.yz.fm(), this.duv.jnr()) * 5.0f));
        if (this.wsy > iFm && 4 == this.duv.wu()) {
            this.fm = (this.wsy - iFm) / 2;
        }
        this.wsy = iFm;
        return new FrameLayout.LayoutParams(this.wsy, this.wu);
    }
}
