Loading packages/SystemUI/res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1174,6 +1174,7 @@ <!-- Output switcher panel related dimensions --> <dimen name="media_output_dialog_list_max_height">355dp</dimen> <dimen name="media_output_dialog_list_item_height">76dp</dimen> <dimen name="media_output_dialog_header_album_icon_size">72dp</dimen> <dimen name="media_output_dialog_header_back_icon_size">32dp</dimen> <dimen name="media_output_dialog_header_icon_padding">16dp</dimen> Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java +10 −3 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements private Button mStopButton; private Button mAppButton; private int mListMaxHeight; private int mItemHeight; private WallpaperColors mWallpaperColors; private Executor mExecutor; private boolean mShouldLaunchLeBroadcastDialog; Loading @@ -106,10 +107,12 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements MediaOutputBaseAdapter mAdapter; private final ViewTreeObserver.OnGlobalLayoutListener mDeviceListLayoutListener = () -> { // Set max height for list if (mDeviceListLayout.getHeight() > mListMaxHeight) { ViewGroup.LayoutParams params = mDeviceListLayout.getLayoutParams(); params.height = mListMaxHeight; int totalItemsHeight = mAdapter.getItemCount() * mItemHeight; int correctHeight = Math.min(totalItemsHeight, mListMaxHeight); // Set max height for list if (correctHeight != params.height) { params.height = correctHeight; mDeviceListLayout.setLayoutParams(params); } }; Loading Loading @@ -212,6 +215,8 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements mLayoutManager = new LayoutManagerWrapper(mContext); mListMaxHeight = context.getResources().getDimensionPixelSize( R.dimen.media_output_dialog_list_max_height); mItemHeight = context.getResources().getDimensionPixelSize( R.dimen.media_output_dialog_list_item_height); mExecutor = Executors.newSingleThreadExecutor(); } Loading Loading @@ -246,8 +251,10 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements mDeviceListLayout.getViewTreeObserver().addOnGlobalLayoutListener( mDeviceListLayoutListener); // Init device list mLayoutManager.setAutoMeasureEnabled(true); mDevicesRecyclerView.setLayoutManager(mLayoutManager); mDevicesRecyclerView.setAdapter(mAdapter); mDevicesRecyclerView.setHasFixedSize(false); // Init header icon mHeaderIcon.setOnClickListener(v -> onHeaderIconClick()); // Init bottom buttons Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1013,7 +1013,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, return; } if (newState == PlaybackState.STATE_STOPPED || newState == PlaybackState.STATE_PAUSED) { if (newState == PlaybackState.STATE_STOPPED) { mCallback.onMediaStoppedOrPaused(); } mCurrentState = newState; Loading Loading
packages/SystemUI/res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1174,6 +1174,7 @@ <!-- Output switcher panel related dimensions --> <dimen name="media_output_dialog_list_max_height">355dp</dimen> <dimen name="media_output_dialog_list_item_height">76dp</dimen> <dimen name="media_output_dialog_header_album_icon_size">72dp</dimen> <dimen name="media_output_dialog_header_back_icon_size">32dp</dimen> <dimen name="media_output_dialog_header_icon_padding">16dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseDialog.java +10 −3 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements private Button mStopButton; private Button mAppButton; private int mListMaxHeight; private int mItemHeight; private WallpaperColors mWallpaperColors; private Executor mExecutor; private boolean mShouldLaunchLeBroadcastDialog; Loading @@ -106,10 +107,12 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements MediaOutputBaseAdapter mAdapter; private final ViewTreeObserver.OnGlobalLayoutListener mDeviceListLayoutListener = () -> { // Set max height for list if (mDeviceListLayout.getHeight() > mListMaxHeight) { ViewGroup.LayoutParams params = mDeviceListLayout.getLayoutParams(); params.height = mListMaxHeight; int totalItemsHeight = mAdapter.getItemCount() * mItemHeight; int correctHeight = Math.min(totalItemsHeight, mListMaxHeight); // Set max height for list if (correctHeight != params.height) { params.height = correctHeight; mDeviceListLayout.setLayoutParams(params); } }; Loading Loading @@ -212,6 +215,8 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements mLayoutManager = new LayoutManagerWrapper(mContext); mListMaxHeight = context.getResources().getDimensionPixelSize( R.dimen.media_output_dialog_list_max_height); mItemHeight = context.getResources().getDimensionPixelSize( R.dimen.media_output_dialog_list_item_height); mExecutor = Executors.newSingleThreadExecutor(); } Loading Loading @@ -246,8 +251,10 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements mDeviceListLayout.getViewTreeObserver().addOnGlobalLayoutListener( mDeviceListLayoutListener); // Init device list mLayoutManager.setAutoMeasureEnabled(true); mDevicesRecyclerView.setLayoutManager(mLayoutManager); mDevicesRecyclerView.setAdapter(mAdapter); mDevicesRecyclerView.setHasFixedSize(false); // Init header icon mHeaderIcon.setOnClickListener(v -> onHeaderIconClick()); // Init bottom buttons Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1013,7 +1013,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, return; } if (newState == PlaybackState.STATE_STOPPED || newState == PlaybackState.STATE_PAUSED) { if (newState == PlaybackState.STATE_STOPPED) { mCallback.onMediaStoppedOrPaused(); } mCurrentState = newState; Loading