package com.bytedance.adsdk.ugeno.ef.ro;

import android.content.Context;
import android.text.TextUtils;
import android.widget.FrameLayout;
import com.bytedance.adsdk.ugeno.ro.fm;

/* JADX INFO: loaded from: classes.dex */
public class ro extends com.bytedance.adsdk.ugeno.ro.fm<com.bytedance.adsdk.ugeno.ef.ro.fm> {
    private com.bytedance.adsdk.ugeno.ef.ro.fm cyr;

    public static class fm extends fm.C0019fm {
        protected int nt;

        public fm(com.bytedance.adsdk.ugeno.ro.fm fmVar) {
            super(fmVar);
            this.nt = -1;
        }

        private int ro(String str) {
            str.getClass();
            switch (str) {
                case "bottom":
                    return 80;
                case "center":
                    return 17;
                case "center_vertical":
                    return 16;
                case "top":
                    return 48;
                case "left":
                    return 3;
                case "right":
                    return 5;
                case "center_horizontal":
                    return 1;
                default:
                    return -1;
            }
        }

        @Override // com.bytedance.adsdk.ugeno.ro.fm.C0019fm
        public void fm(Context context, String str, String str2) {
            if (TextUtils.isEmpty(str)) {
                return;
            }
            super.fm(context, str, str2);
            if (TextUtils.equals(str, "layoutGravity")) {
                this.nt = fm(str2);
            }
        }

        @Override // com.bytedance.adsdk.ugeno.ro.fm.C0019fm
        /* JADX INFO: renamed from: ro, reason: merged with bridge method [inline-methods] */
        public FrameLayout.LayoutParams fm() {
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams((int) this.fm, (int) this.ro);
            layoutParams.leftMargin = (int) this.ajl;
            layoutParams.rightMargin = (int) this.wsy;
            layoutParams.topMargin = (int) this.wu;
            layoutParams.bottomMargin = (int) this.f6371ef;
            layoutParams.gravity = this.nt;
            return layoutParams;
        }

        private int fm(String str) {
            String[] strArrSplit;
            if (TextUtils.isEmpty(str) || (strArrSplit = str.split("\\|")) == null || strArrSplit.length <= 0) {
                return -1;
            }
            int iRo = 0;
            for (String str2 : strArrSplit) {
                iRo |= ro(str2);
            }
            return iRo;
        }
    }

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

    @Override // com.bytedance.adsdk.ugeno.ro.lb
    /* JADX INFO: renamed from: lb, reason: merged with bridge method [inline-methods] */
    public com.bytedance.adsdk.ugeno.ef.ro.fm fm() {
        com.bytedance.adsdk.ugeno.ef.ro.fm fmVar = new com.bytedance.adsdk.ugeno.ef.ro.fm(this.ro);
        this.cyr = fmVar;
        fmVar.fm(this);
        return this.cyr;
    }

    @Override // com.bytedance.adsdk.ugeno.ro.fm, com.bytedance.adsdk.ugeno.ro.lb
    public void ro() {
        this.cyr.setEventMap(this.f6383pf);
        super.ro();
    }

    @Override // com.bytedance.adsdk.ugeno.ro.fm
    public fm.C0019fm vt() {
        return new fm(this);
    }
}
