File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
java/com/naman14/timberx/ui/fragments/songs Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import android.view.View
2020import android.view.ViewGroup
2121import androidx.recyclerview.widget.LinearLayoutManager
2222import com.afollestad.rxkprefs.Pref
23+ import com.google.android.material.snackbar.Snackbar
2324import com.naman14.timberx.PREF_SONG_SORT_ORDER
2425import com.naman14.timberx.R
2526import com.naman14.timberx.constants.SongSortOrder
@@ -93,7 +94,13 @@ class SongsFragment : MediaItemFragment() {
9394 override fun shuffleAll () {
9495 songsAdapter.songs.shuffled().apply {
9596 val extras = getExtraBundle(toSongIds(), getString(R .string.all_songs))
96- mainViewModel.mediaItemClicked(this [0 ], extras)
97+
98+ if (this .isEmpty()) {
99+ Snackbar .make(recyclerView, R .string.shuffle_no_songs_error, Snackbar .LENGTH_SHORT )
100+ .show()
101+ } else {
102+ mainViewModel.mediaItemClicked(this [0 ], extras)
103+ }
97104 }
98105 }
99106
Original file line number Diff line number Diff line change 4444 <string name =" no_song_next" >No song up next</string >
4545
4646 <string name =" play_song_error" >Unable to play song</string >
47+ <string name =" shuffle_no_songs_error" >There\'s no songs to shuffle</string >
4748 <string name =" new_playlist" >New Playlist</string >
4849 <string name =" lyrics" >Lyrics</string >
4950 <string name =" up_next" >Up Next</string >
You can’t perform that action at this time.
0 commit comments