Skip to content

Commit 64da8d8

Browse files
committed
feat: Optimized media output panel availability checks
Adjusted media output panel availability check logic based on Android version. - For Android 14 and above, assume the panel is always available. - For Android 12 and 13, check if the system UI can handle the media output dialog intent. - For Android 11 and below, check if the Settings app can handle the media output panel intent. If the panel is unavailable, hide the media control buttons. Signed-off-by: ghhccghk <2137610394@qq.com>
1 parent efe17a0 commit 64da8d8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/main/java/org/akanework/gramophone/ui/components/FullBottomSheet.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,16 @@ class FullBottomSheet
433433

434434
bottomSheetFavoriteButton.addOnCheckedChangeListener(this)
435435

436+
if (isMediaOutputPanelSupported(context)){
437+
bottomSheetMediaControl.setOnClickListener {
438+
SystemMediaControlResolver(context).intentSystemMediaDialog()
439+
}
440+
} else {
441+
bottomSheetMediaControl.visibility = GONE
442+
}
443+
444+
445+
436446
bottomSheetPlaylistButton.setOnClickListener {
437447
ViewCompat.performHapticFeedback(it, HapticFeedbackConstantsCompat.CONTEXT_CLICK)
438448
if (instance != null)

0 commit comments

Comments
 (0)