diff options
author | 2023-05-12 18:28:03 +0000 | |
---|---|---|
committer | 2023-05-12 18:28:03 +0000 | |
commit | 7a227f1e7400b23f74c3dadc8c75ec8f3b09c31a (patch) | |
tree | 073b0b6dfba99f4b44b04752a0b4d2730ff4bb4e | |
parent | 8c0763be257950b718820fbfd69a5af1da97d264 (diff) | |
parent | b130b003a543d8c9c17379fdfaa2686b65cc3cc4 (diff) |
Merge "[Output Switcher] Set padding to fix clip on top item" into udc-dev am: b130b003a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23124521
Change-Id: I7f5083f50895fef5972c278b0093088e4329e7fd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
3 files changed, 9 insertions, 2 deletions
diff --git a/packages/SystemUI/res/layout/media_output_dialog.xml b/packages/SystemUI/res/layout/media_output_dialog.xml index e182a6ae78de..9c1dc6448b4b 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"> <ImageView android:id="@+id/header_icon" @@ -113,6 +113,8 @@ <androidx.recyclerview.widget.RecyclerView android:id="@+id/list_result" android:scrollbars="vertical" + android:paddingTop="8dp" + android:clipToPadding="false" android:layout_width="match_parent" android:layout_height="wrap_content"/> </LinearLayout> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 2024daefbdff..64615fb37f7c 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1318,6 +1318,7 @@ <dimen name="media_output_dialog_active_background_radius">28dp</dimen> <dimen name="media_output_dialog_default_margin_end">16dp</dimen> <dimen name="media_output_dialog_selectable_margin_end">80dp</dimen> + <dimen name="media_output_dialog_list_padding_top">8dp</dimen> <!-- Distance that the full shade transition takes in order to complete by tapping on a button like "expand". --> 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 770e4dfe0d7d..08b799aaafc7 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(); } |