From f9b57802930ec6241c0644ef7430350ed6d45a9e Mon Sep 17 00:00:00 2001 From: Robert Horvath Date: Wed, 3 May 2023 08:37:22 +0000 Subject: [PATCH] Fix TV AlertDialog minimum button bar height AlertDialogLayout gives the buttonPanel its requested minimum height, or that of the buttonPanel's single child. The buttonPanel is a ScrollView with padding that contains a single ButtonBarLayout. The ButtonBarLayout calculates a minimum height of its button's height + its padding. But since the ButtonBarLayout itself doesn't have padding, its minHeight is the exact height of its buttons. The AlertDialogLayout lays out the buttonPanel ScrollView with that height, but the ScrollView applies its padding, pushing the buttons out of bounds and clipping them. This change moves the padding to the ButtonBarLayout, so that it takes the padding into account when calculating its minimum height. Bug: 280552754 Test: manual Change-Id: Iba521df606129e73e7549b0cf030c4091467d0aa --- core/res/res/layout/alert_dialog_button_bar_leanback.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/res/res/layout/alert_dialog_button_bar_leanback.xml b/core/res/res/layout/alert_dialog_button_bar_leanback.xml index ea94af662dcfe..466811f6d116b 100644 --- a/core/res/res/layout/alert_dialog_button_bar_leanback.xml +++ b/core/res/res/layout/alert_dialog_button_bar_leanback.xml @@ -21,13 +21,13 @@ android:layout_height="wrap_content" android:scrollbarAlwaysDrawVerticalTrack="true" android:scrollIndicators="top|bottom" - android:fillViewport="true" - style="?attr/buttonBarStyle"> + android:fillViewport="true">