diff --git a/packages/SystemUI/res/layout/media_output_dialog.xml b/packages/SystemUI/res/layout/media_output_dialog.xml index e182a6ae78deb..9c1dc6448b4bd 100644 --- a/packages/SystemUI/res/layout/media_output_dialog.xml +++ b/packages/SystemUI/res/layout/media_output_dialog.xml @@ -31,7 +31,7 @@ android:paddingStart="16dp" android:paddingTop="16dp" android:paddingEnd="16dp" - android:paddingBottom="24dp" + android:paddingBottom="16dp" android:orientation="horizontal"> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 2024daefbdff0..64615fb37f7cf 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1318,6 +1318,7 @@ 28dp 16dp 80dp + 8dp diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java index 770e4dfe0d7d1..08b799aaafc75 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java @@ -101,6 +101,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements private Button mAppButton; private int mListMaxHeight; private int mItemHeight; + private int mListPaddingTop; private WallpaperColors mWallpaperColors; private boolean mShouldLaunchLeBroadcastDialog; private boolean mIsLeBroadcastCallbackRegistered; @@ -111,7 +112,8 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements private final ViewTreeObserver.OnGlobalLayoutListener mDeviceListLayoutListener = () -> { ViewGroup.LayoutParams params = mDeviceListLayout.getLayoutParams(); - int totalItemsHeight = mAdapter.getItemCount() * mItemHeight; + int totalItemsHeight = mAdapter.getItemCount() * mItemHeight + + mListPaddingTop; int correctHeight = Math.min(totalItemsHeight, mListMaxHeight); // Set max height for list if (correctHeight != params.height) { @@ -220,6 +222,8 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements R.dimen.media_output_dialog_list_max_height); mItemHeight = context.getResources().getDimensionPixelSize( R.dimen.media_output_dialog_list_item_height); + mListPaddingTop = mContext.getResources().getDimensionPixelSize( + R.dimen.media_output_dialog_list_padding_top); mExecutor = Executors.newSingleThreadExecutor(); }