package android.support.constraint;

import android.content.Context;
import android.support.constraint.a.a;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;

public class Constraints extends ViewGroup {
    a fp;

    public Constraints(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        super.setVisibility(8);
    }

    public Constraints(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        super.setVisibility(8);
    }

    /* Access modifiers changed, original: protected */
    public LayoutParams generateLayoutParams(LayoutParams layoutParams) {
        return new ConstraintLayout.LayoutParams(layoutParams);
    }

    public a getConstraintSet() {
        if (this.fp == null) {
            this.fp = new a();
        }
        a aVar = this.fp;
        int childCount = getChildCount();
        aVar.eL.clear();
        for (int i = 0; i < childCount; i++) {
            View childAt = getChildAt(i);
            LayoutParams layoutParams = (LayoutParams) childAt.getLayoutParams();
            int id = childAt.getId();
            if (id == -1) {
                throw new RuntimeException("All children of ConstraintLayout must have ids to use ConstraintSet");
            }
            if (!aVar.eL.containsKey(Integer.valueOf(id))) {
                aVar.eL.put(Integer.valueOf(id), new a((byte) 0));
            }
            a aVar2 = (a) aVar.eL.get(Integer.valueOf(id));
            if (childAt instanceof ConstraintHelper) {
                ConstraintHelper constraintHelper = (ConstraintHelper) childAt;
                aVar2.a(id, layoutParams);
                if (constraintHelper instanceof Barrier) {
                    aVar2.fl = 1;
                    Barrier barrier = (Barrier) constraintHelper;
                    aVar2.fk = barrier.getType();
                    aVar2.fn = barrier.getReferencedIds();
                }
            }
            aVar2.a(id, layoutParams);
        }
        return this.fp;
    }

    /* Access modifiers changed, original: protected */
    public void onLayout(boolean z, int i, int i2, int i3, int i4) {
    }

    /* Access modifiers changed, original: protected|synthetic */
    public /* synthetic */ LayoutParams generateDefaultLayoutParams() {
        return new LayoutParams();
    }
}
