package androidx.leanback.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import p037.p091.C2077;
import p037.p091.p095.C2138;
import p037.p091.p095.C2155;

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

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

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public boolean f709;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public InterfaceC0112 f710;

    /* JADX INFO: renamed from: androidx.leanback.widget.GuidedActionsRelativeLayout$֏, reason: contains not printable characters */
    public interface InterfaceC0112 {
    }

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

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

    public GuidedActionsRelativeLayout(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        this.f709 = false;
        this.f708 = GuidanceStylingRelativeLayout.m276(context);
    }

    @Override // android.view.ViewGroup, android.view.View
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        boolean z;
        C2138 c2138;
        InterfaceC0112 interfaceC0112 = this.f710;
        if (interfaceC0112 != null) {
            C2155.C2156 c2156 = (C2155.C2156) interfaceC0112;
            if (c2156 == null) {
                throw null;
            }
            if (keyEvent.getKeyCode() == 4 && keyEvent.getAction() == 1 && (c2138 = C2155.this.f7039) != null && ((c2138.m4176() && C2155.this.f7041) || (C2155.this.f7039.m4174() && C2155.this.f7042))) {
                C2155.this.m4216(true);
                z = true;
            } else {
                z = false;
            }
            if (z) {
                return true;
            }
        }
        return super.dispatchKeyEvent(keyEvent);
    }

    @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);
        this.f709 = false;
    }

    @Override // android.widget.RelativeLayout, android.view.View
    public void onMeasure(int i, int i2) {
        View viewFindViewById;
        int size = View.MeasureSpec.getSize(i2);
        if (size > 0 && (viewFindViewById = findViewById(C2077.guidedactions_sub_list)) != null) {
            ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) viewFindViewById.getLayoutParams();
            if (marginLayoutParams.topMargin < 0 && !this.f709) {
                this.f709 = true;
            }
            if (this.f709) {
                marginLayoutParams.topMargin = (int) ((this.f708 * size) / 100.0f);
            }
        }
        super.onMeasure(i, i2);
    }
}
