package com.bytedance.ies.sdk.widgets;

import X.05h;
import X.M12;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.ViewGroup;
import com.bytedance.covode.number.Covode;

public final class LayeredConstraintLayout$LayoutParams extends 05h {
    public int layer;
    public int order;
    public int weight;

    static {
        Covode.recordClassIndex(30500);
    }

    public final int getLayer() {
        return this.layer;
    }

    public final int getOrder() {
        return this.order;
    }

    public final /* synthetic */ int getWeight$widget_release() {
        return this.weight;
    }

    private final void resolveWeight() {
        this.weight = (this.layer * 1000) + this.order;
    }

    public final /* synthetic */ void setWeight$widget_release(int i) {
        this.weight = i;
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public LayeredConstraintLayout$LayoutParams(05h r1) {
        super(r1);
        M12.LIZ(r1);
    }

    public final void setLayer(int i) {
        this.layer = i;
        resolveWeight();
    }

    public final void setOrder(int i) {
        this.order = i;
        resolveWeight();
    }

    public LayeredConstraintLayout$LayoutParams(ViewGroup.LayoutParams layoutParams) {
        super(layoutParams);
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public LayeredConstraintLayout$LayoutParams(LayeredConstraintLayout$LayoutParams layeredConstraintLayout$LayoutParams) {
        super(layeredConstraintLayout$LayoutParams);
        M12.LIZ(layeredConstraintLayout$LayoutParams);
        setLayer(layeredConstraintLayout$LayoutParams.layer);
        setOrder(layeredConstraintLayout$LayoutParams.order);
    }

    public LayeredConstraintLayout$LayoutParams(int i, int i2) {
        super(i, i2);
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public LayeredConstraintLayout$LayoutParams(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        M12.LIZ(context);
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, new int[]{2130969797, 2130969804});
        int indexCount = obtainStyledAttributes.getIndexCount();
        if (indexCount > 0) {
            int i = 0;
            while (true) {
                int i2 = i + 1;
                if (obtainStyledAttributes.getIndex(i) == 0) {
                    setLayer(obtainStyledAttributes.getInt(0, 0));
                } else if (obtainStyledAttributes.getIndex(i) == 1) {
                    setOrder(obtainStyledAttributes.getInt(1, 0));
                }
                if (i2 >= indexCount) {
                    break;
                }
                i = i2;
            }
        }
        obtainStyledAttributes.recycle();
    }
}
