package androidx.leanback.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import p037.p091.C2077;
import p037.p091.C2083;

/* JADX INFO: loaded from: classes.dex */
public class GuidanceStylingRelativeLayout extends RelativeLayout {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public float f702;

    public GuidanceStylingRelativeLayout(Context context) {
        this(context, null);
    }

    public GuidanceStylingRelativeLayout(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public GuidanceStylingRelativeLayout(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.f702 = m276(context);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static float m276(Context context) {
        TypedArray typedArrayObtainStyledAttributes = context.getTheme().obtainStyledAttributes(C2083.LeanbackGuidedStepTheme);
        float f = typedArrayObtainStyledAttributes.getFloat(C2083.LeanbackGuidedStepTheme_guidedStepKeyline, 40.0f);
        typedArrayObtainStyledAttributes.recycle();
        return f;
    }

    @Override // android.widget.RelativeLayout, android.view.ViewGroup, android.view.View
    public void onLayout(boolean z, int i, int i2, int i3, int i4) {
        super.onLayout(z, i, i2, i3, i4);
        View viewFindViewById = getRootView().findViewById(C2077.guidance_title);
        View viewFindViewById2 = getRootView().findViewById(C2077.guidance_breadcrumb);
        View viewFindViewById3 = getRootView().findViewById(C2077.guidance_description);
        ImageView imageView = (ImageView) getRootView().findViewById(C2077.guidance_icon);
        int measuredHeight = (int) ((getMeasuredHeight() * this.f702) / 100.0f);
        if (viewFindViewById != null && viewFindViewById.getParent() == this) {
            int baseline = (((measuredHeight - viewFindViewById.getBaseline()) - viewFindViewById2.getMeasuredHeight()) - viewFindViewById.getPaddingTop()) - viewFindViewById2.getTop();
            if (viewFindViewById2.getParent() == this) {
                viewFindViewById2.offsetTopAndBottom(baseline);
            }
            viewFindViewById.offsetTopAndBottom(baseline);
            if (viewFindViewById3 != null && viewFindViewById3.getParent() == this) {
                viewFindViewById3.offsetTopAndBottom(baseline);
            }
        }
        if (imageView == null || imageView.getParent() != this || imageView.getDrawable() == null) {
            return;
        }
        imageView.offsetTopAndBottom(measuredHeight - (imageView.getMeasuredHeight() / 2));
    }
}
