package com.vinfast.companion.core.base.ui.widget;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\b\u0018\u00002\u00020\u0001B\u0019\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004¢\u0006\u0004\b\u0006\u0010\u0007J!\u0010\t\u001a\u00020\b2\u0006\u0010\u0003\u001a\u00020\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004H\u0002¢\u0006\u0004\b\t\u0010\u0007J\u001f\u0010\r\u001a\u00020\b2\u0006\u0010\u000b\u001a\u00020\n2\u0006\u0010\f\u001a\u00020\nH\u0014¢\u0006\u0004\b\r\u0010\u000eR\u0016\u0010\u0011\u001a\u00020\n8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u000f\u0010\u0010¨\u0006\u0012"}, d2 = {"Lcom/vinfast/companion/core/base/ui/widget/MaxHeightRecyclerView;", "Landroidx/recyclerview/widget/RecyclerView;", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "", "P", "", "widthSpec", "heightSpec", "onMeasure", "(II)V", "a", "I", "maxHeight", "core_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
public final class MaxHeightRecyclerView extends androidx.recyclerview.widget.RecyclerView {

    /* JADX INFO: renamed from: a, reason: from kotlin metadata */
    private int maxHeight;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public MaxHeightRecyclerView(@org.jetbrains.annotations.NotNull android.content.Context context, @org.jetbrains.annotations.Nullable android.util.AttributeSet attributeSet) {
        super(context, attributeSet);
        kotlin.jvm.internal.Intrinsics.l(context, "context");
        P(context, attributeSet);
    }

    private final void P(android.content.Context context, android.util.AttributeSet attrs) {
        android.content.res.TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attrs, com.vinfast.companion.core.R.styleable.MaxHeightRecyclerView);
        this.maxHeight = typedArrayObtainStyledAttributes.getLayoutDimension(com.vinfast.companion.core.R.styleable.MaxHeightRecyclerView_rv_maxHeight, this.maxHeight);
        typedArrayObtainStyledAttributes.recycle();
    }

    protected void onMeasure(int widthSpec, int heightSpec) {
        int i = this.maxHeight;
        if (i > 0) {
            heightSpec = android.view.View.MeasureSpec.makeMeasureSpec(i, Integer.MIN_VALUE);
        }
        super.onMeasure(widthSpec, heightSpec);
    }
}
