package d0;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public final class d extends ViewGroup.MarginLayoutParams {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public b f24884a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f24885b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f24886c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f24887d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final int f24888e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int f24889f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final int f24890g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public int f24891h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public int f24892i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int f24893j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public View f24894k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public View f24895l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f24896m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public boolean f24897n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public boolean f24898o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public boolean f24899p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final Rect f24900q;

    public d() {
        super(-2, -2);
        this.f24885b = false;
        this.f24886c = 0;
        this.f24887d = 0;
        this.f24888e = -1;
        this.f24889f = -1;
        this.f24890g = 0;
        this.f24891h = 0;
        this.f24900q = new Rect();
    }

    public final boolean a(int i10) {
        if (i10 == 0) {
            return this.f24897n;
        }
        if (i10 != 1) {
            return false;
        }
        return this.f24898o;
    }

    public d(Context context, AttributeSet attributeSet) {
        b bVar;
        super(context, attributeSet);
        this.f24885b = false;
        this.f24886c = 0;
        this.f24887d = 0;
        this.f24888e = -1;
        this.f24889f = -1;
        this.f24890g = 0;
        this.f24891h = 0;
        this.f24900q = new Rect();
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, c0.c.CoordinatorLayout_Layout);
        this.f24886c = typedArrayObtainStyledAttributes.getInteger(c0.c.CoordinatorLayout_Layout_android_layout_gravity, 0);
        this.f24889f = typedArrayObtainStyledAttributes.getResourceId(c0.c.CoordinatorLayout_Layout_layout_anchor, -1);
        this.f24887d = typedArrayObtainStyledAttributes.getInteger(c0.c.CoordinatorLayout_Layout_layout_anchorGravity, 0);
        this.f24888e = typedArrayObtainStyledAttributes.getInteger(c0.c.CoordinatorLayout_Layout_layout_keyline, -1);
        this.f24890g = typedArrayObtainStyledAttributes.getInt(c0.c.CoordinatorLayout_Layout_layout_insetEdge, 0);
        this.f24891h = typedArrayObtainStyledAttributes.getInt(c0.c.CoordinatorLayout_Layout_layout_dodgeInsetEdges, 0);
        int i10 = c0.c.CoordinatorLayout_Layout_layout_behavior;
        boolean zHasValue = typedArrayObtainStyledAttributes.hasValue(i10);
        this.f24885b = zHasValue;
        if (zHasValue) {
            String string = typedArrayObtainStyledAttributes.getString(i10);
            String str = CoordinatorLayout.W;
            if (TextUtils.isEmpty(string)) {
                bVar = null;
            } else {
                if (string.startsWith(".")) {
                    string = context.getPackageName() + string;
                } else if (string.indexOf(46) < 0) {
                    String str2 = CoordinatorLayout.W;
                    if (!TextUtils.isEmpty(str2)) {
                        string = str2 + '.' + string;
                    }
                }
                try {
                    ThreadLocal threadLocal = CoordinatorLayout.f1500b0;
                    Map map = (Map) threadLocal.get();
                    if (map == null) {
                        map = new HashMap();
                        threadLocal.set(map);
                    }
                    Constructor<?> constructor = (Constructor) map.get(string);
                    if (constructor == null) {
                        constructor = Class.forName(string, false, context.getClassLoader()).getConstructor(CoordinatorLayout.f1499a0);
                        constructor.setAccessible(true);
                        map.put(string, constructor);
                    }
                    bVar = (b) constructor.newInstance(context, attributeSet);
                } catch (Exception e10) {
                    throw new RuntimeException(defpackage.e.i("Could not inflate Behavior subclass ", string), e10);
                }
            }
            this.f24884a = bVar;
        }
        typedArrayObtainStyledAttributes.recycle();
        b bVar2 = this.f24884a;
        if (bVar2 != null) {
            bVar2.g(this);
        }
    }

    public d(d dVar) {
        super((ViewGroup.MarginLayoutParams) dVar);
        this.f24885b = false;
        this.f24886c = 0;
        this.f24887d = 0;
        this.f24888e = -1;
        this.f24889f = -1;
        this.f24890g = 0;
        this.f24891h = 0;
        this.f24900q = new Rect();
    }

    public d(ViewGroup.MarginLayoutParams marginLayoutParams) {
        super(marginLayoutParams);
        this.f24885b = false;
        this.f24886c = 0;
        this.f24887d = 0;
        this.f24888e = -1;
        this.f24889f = -1;
        this.f24890g = 0;
        this.f24891h = 0;
        this.f24900q = new Rect();
    }

    public d(ViewGroup.LayoutParams layoutParams) {
        super(layoutParams);
        this.f24885b = false;
        this.f24886c = 0;
        this.f24887d = 0;
        this.f24888e = -1;
        this.f24889f = -1;
        this.f24890g = 0;
        this.f24891h = 0;
        this.f24900q = new Rect();
    }
}
