package com.flurry.android;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import java.util.Map;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: /storage/emulated/0/Documents/jadec/sources/com.UBI.A90.WW/dex-files/0.dex */
public abstract class o extends RelativeLayout {
    be a;
    bb b;
    AdUnit c;
    int d;
    private Context e;

    public abstract void initLayout(Context context);

    /* JADX INFO: Access modifiers changed from: package-private */
    public o(Context context, be beVar, bb bbVar) {
        super(context);
        a(context, beVar, bbVar);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public o(Context context) {
        super(context);
        a(context, null, null);
    }

    private void a(Context context, be beVar, bb bbVar) {
        this.e = context;
        this.a = beVar;
        this.b = bbVar;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void a(String str, Map<String, String> map) {
        String str2 = "AppSpotBannerView.onEvent " + str;
        this.a.a(this.b, str, true, map);
        if (this.c != null) {
            this.a.a(new ba(str, map, this.e, this.c, this.b, 0), this.a, 0);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public boolean a() {
        return !this.c.c().get(0).d().d().toString().equals(AdCreative.kFormatTakeover);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public final void a(ViewGroup viewGroup, t tVar) {
        if (this.c != null && this.c.c().size() >= 1) {
            if (!(viewGroup instanceof RelativeLayout)) {
                tVar.setLayoutParams(new ViewGroup.LayoutParams(-2, -2));
                return;
            }
            AdSpaceLayout d = this.c.c().get(0).d();
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(y.b(this.e, d.a().intValue()), y.b(this.e, d.b().intValue()));
            String[] split = d.e().toString().split("-");
            if (split.length == 2) {
                if (split[0].equals(Constants.ALIGN_BOTTOM)) {
                    layoutParams.addRule(12);
                } else if (split[0].equals(Constants.ALIGN_TOP)) {
                    layoutParams.addRule(10);
                } else if (split[0].equals(Constants.ALIGN_MIDDLE)) {
                    layoutParams.addRule(15);
                }
                if (split[1].equals(Constants.ALIGN_CENTER)) {
                    layoutParams.addRule(14);
                } else if (split[1].equals(Constants.ALIGN_LEFT)) {
                    layoutParams.addRule(9);
                } else if (split[1].equals(Constants.ALIGN_RIGHT)) {
                    layoutParams.addRule(11);
                }
            }
            tVar.setLayoutParams(layoutParams);
        }
    }
}
