removed Play next feature for currently playing track

This commit is contained in:
Yashraj254 2023-07-19 05:02:27 +05:30
parent 95dcdad1aa
commit 4ea384da53
3 changed files with 6 additions and 3 deletions

View file

@ -84,7 +84,8 @@ class AlbumsTracksAdapter(
override fun prepareActionMode(menu: Menu) {
menu.apply {
findItem(R.id.cab_play_next).isVisible = isOneItemSelected() && MusicService.mCurrTrack != getSelectedTracks().firstOrNull() && isATrack()
findItem(R.id.cab_play_next).isVisible =
isOneItemSelected() && MusicService.mCurrTrack != getSelectedTracks().firstOrNull() && isATrack() && MusicService.mCurrTrack !== null
}
}

View file

@ -84,7 +84,8 @@ class TracksAdapter(
findItem(R.id.cab_remove_from_playlist).isVisible = isPlaylistContent
findItem(R.id.cab_rename).isVisible =
isOneItemSelected() && getSelectedTracks().firstOrNull()?.let { !it.path.startsWith("content://") && tagHelper.isEditTagSupported(it) } == true
findItem(R.id.cab_play_next).isVisible = isOneItemSelected() && MusicService.mCurrTrack != getSelectedTracks().firstOrNull()
findItem(R.id.cab_play_next).isVisible =
isOneItemSelected() && MusicService.mCurrTrack != getSelectedTracks().firstOrNull() && MusicService.mCurrTrack !== null
}
}

View file

@ -77,7 +77,8 @@ class TracksHeaderAdapter(activity: SimpleActivity, var items: ArrayList<ListIte
val oneItemsSelected = isOneItemSelected()
val selected = getSelectedTracks().firstOrNull()?.let { !it.path.startsWith("content://") && tagHelper.isEditTagSupported(it) } == true
findItem(R.id.cab_rename).isVisible = oneItemsSelected && selected
findItem(R.id.cab_play_next).isVisible = isOneItemSelected() && MusicService.mCurrTrack != getSelectedTracks().firstOrNull()
findItem(R.id.cab_play_next).isVisible =
isOneItemSelected() && MusicService.mCurrTrack != getSelectedTracks().firstOrNull() && MusicService.mCurrTrack !== null
}
}