package com.bytedance.adsdk.ugeno.ro;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import com.bytedance.adsdk.ugeno.wsy.wu;
import java.util.ArrayList;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public class fm<E extends ViewGroup> extends lb {
    protected List<lb<View>> fm;

    public fm(Context context) {
        this(context, null);
    }

    public List<lb<View>> ef() {
        return this.fm;
    }

    public void fm(lb lbVar) {
        if (lbVar == null) {
            return;
        }
        this.fm.add(lbVar);
        View viewKu = lbVar.ku();
        if (viewKu != null) {
            ((ViewGroup) this.jnr).addView(viewKu);
        }
    }

    @Override // com.bytedance.adsdk.ugeno.ro.lb
    public lb lb(String str) {
        lb<T> lbVarWsy;
        if (!TextUtils.isEmpty(str) && TextUtils.equals(str, this.duv) && this.ywr == 0) {
            return this;
        }
        if (this.ywr != 0) {
            return null;
        }
        for (lb<View> lbVar : this.fm) {
            if (lbVar != null && (lbVarWsy = lbVar.wsy(str)) != 0) {
                return lbVarWsy;
            }
        }
        return null;
    }

    @Override // com.bytedance.adsdk.ugeno.ro.lb
    public void ro() {
        super.ro();
    }

    public C0019fm vt() {
        return new C0019fm(this);
    }

    @Override // com.bytedance.adsdk.ugeno.ro.lb
    public lb yz(String str) {
        lb<T> lbVarWu;
        if (!TextUtils.isEmpty(str) && duv(str) != null) {
            return this;
        }
        for (lb<View> lbVar : this.fm) {
            if (lbVar != null && (lbVarWu = lbVar.wu(str)) != 0) {
                return lbVarWu;
            }
        }
        return null;
    }

    public fm(Context context, fm fmVar) {
        super(context, fmVar);
        this.fm = new ArrayList();
    }

    @Override // com.bytedance.adsdk.ugeno.ro.lb
    public lb ro(String str) {
        lb<T> lbVarAjl;
        if (!TextUtils.isEmpty(str) && TextUtils.equals(str, this.duv)) {
            return this;
        }
        for (lb<View> lbVar : this.fm) {
            if (lbVar != null && (lbVarAjl = lbVar.ajl(str)) != 0) {
                return lbVarAjl;
            }
        }
        return null;
    }

    public void fm(lb lbVar, ViewGroup.LayoutParams layoutParams) {
        if (lbVar == null) {
            return;
        }
        this.fm.add(lbVar);
        View viewKu = lbVar.ku();
        if (viewKu != null) {
            ((ViewGroup) this.jnr).addView(viewKu, layoutParams);
        }
    }

    @Override // com.bytedance.adsdk.ugeno.ro.lb
    public lb fm(String str) {
        lb<T> lbVarJnr;
        if (!TextUtils.isEmpty(str) && TextUtils.equals(str, this.ku)) {
            return this;
        }
        for (lb<View> lbVar : this.fm) {
            if (lbVar != null && (lbVarJnr = lbVar.jnr(str)) != 0) {
                return lbVarJnr;
            }
        }
        return null;
    }

    /* JADX INFO: renamed from: com.bytedance.adsdk.ugeno.ro.fm$fm, reason: collision with other inner class name */
    public static class C0019fm {
        protected float ajl;
        protected float dsz;
        protected float duv;

        /* JADX INFO: renamed from: ef, reason: collision with root package name */
        protected float f6371ef;
        protected boolean fhx;
        protected boolean gof;
        protected boolean gqi;
        protected fm hi;
        protected ViewGroup.LayoutParams hlt;
        protected boolean irt;
        protected float jnr;
        protected float ku;
        protected boolean lse;
        protected boolean maa;
        protected float onz;
        protected boolean qhl;
        protected boolean sds;
        protected float vt;
        protected boolean wey;
        protected float wsy;
        protected float wu;
        protected float fm = -2.0f;
        protected float ro = -2.0f;

        /* JADX INFO: renamed from: lb, reason: collision with root package name */
        protected float f6372lb = 0.0f;
        protected float yz = 0.0f;

        public C0019fm(fm fmVar) {
            this.hi = fmVar;
        }

        public void fm(Context context, String str, String str2) {
            if (TextUtils.isEmpty(str)) {
            }
            str.getClass();
            switch (str) {
                case "paddingLeft":
                    this.ku = wu.fm(context, str2);
                    this.irt = true;
                    break;
                case "minWidth":
                    this.f6372lb = wu.fm(context, str2);
                    break;
                case "height":
                    if (TextUtils.equals(str2, "match_parent")) {
                        this.ro = -1.0f;
                        break;
                    } else {
                        if (!TextUtils.equals(str2, "wrap_content")) {
                            this.ro = wu.fm(context, str2);
                        } else {
                            this.ro = -2.0f;
                        }
                        break;
                    }
                    break;
                case "margin":
                    this.jnr = wu.fm(context, str2);
                    break;
                case "marginTop":
                    this.wu = wu.fm(context, str2);
                    this.maa = true;
                    break;
                case "padding":
                    this.vt = wu.fm(context, str2);
                    this.fhx = true;
                    break;
                case "marginBottom":
                    this.f6371ef = wu.fm(context, str2);
                    this.lse = true;
                    break;
                case "minHeight":
                    this.yz = wu.fm(context, str2);
                    break;
                case "paddingTop":
                    this.duv = wu.fm(context, str2);
                    this.gof = true;
                    break;
                case "width":
                    if (TextUtils.equals(str2, "match_parent")) {
                        this.fm = -1.0f;
                        break;
                    } else {
                        if (!TextUtils.equals(str2, "wrap_content")) {
                            this.fm = wu.fm(context, str2);
                        } else {
                            this.fm = -2.0f;
                        }
                        break;
                    }
                    break;
                case "paddingBottom":
                    this.onz = wu.fm(context, str2);
                    this.gqi = true;
                    break;
                case "paddingRight":
                    this.dsz = wu.fm(context, str2);
                    this.qhl = true;
                    break;
                case "marginRight":
                    this.wsy = wu.fm(context, str2);
                    this.sds = true;
                    break;
                case "marginLeft":
                    this.ajl = wu.fm(context, str2);
                    this.wey = true;
                    break;
            }
        }

        public String toString() {
            return "LayoutParams{mWidth=" + this.fm + ", mHeight=" + this.ro + ", mMargin=" + this.jnr + ", mMarginLeft=" + this.ajl + ", mMarginRight=" + this.wsy + ", mMarginTop=" + this.wu + ", mMarginBottom=" + this.f6371ef + ", mParams=" + this.hlt + '}';
        }

        public ViewGroup.LayoutParams fm() {
            ViewGroup.MarginLayoutParams marginLayoutParams = new ViewGroup.MarginLayoutParams((int) this.fm, (int) this.ro);
            marginLayoutParams.leftMargin = (int) (this.wey ? this.ajl : this.jnr);
            marginLayoutParams.rightMargin = (int) (this.sds ? this.wsy : this.jnr);
            marginLayoutParams.topMargin = (int) (this.maa ? this.wu : this.jnr);
            marginLayoutParams.bottomMargin = (int) (this.lse ? this.f6371ef : this.jnr);
            return marginLayoutParams;
        }
    }
}
