Skip to content
This repository was archived by the owner on Aug 24, 2023. It is now read-only.

Commit c217e46

Browse files
committed
HomeFragment: Bump shuffle list's song number to 10
Signed-off-by: Shinjo Akane <[email protected]>
1 parent 6ad69bf commit c217e46

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

app/src/main/java/org/akanework/symphonica/ui/fragment/HomeFragment.kt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,10 @@ class HomeFragment : Fragment() {
318318

319319
private fun initializeList() {
320320
if (shuffleList.isEmpty() && libraryViewModel.librarySongList.isNotEmpty()) {
321-
shuffleList.add(libraryViewModel.librarySongList.random())
322-
shuffleList.add(libraryViewModel.librarySongList.random())
323-
shuffleList.add(libraryViewModel.librarySongList.random())
324-
shuffleList.add(libraryViewModel.librarySongList.random())
325-
shuffleList.add(libraryViewModel.librarySongList.random())
326-
shuffleAdapter.notifyItemRangeChanged(0, 5)
321+
for (i in 1..10) {
322+
shuffleList.add(libraryViewModel.librarySongList.random())
323+
}
324+
shuffleAdapter.notifyItemRangeChanged(0, 10)
327325
}
328326
if (libraryViewModel.libraryNewestAddedList.isNotEmpty() && recentList.isEmpty()) {
329327
recentList.addAll(0, libraryViewModel.libraryNewestAddedList)
@@ -340,12 +338,10 @@ class HomeFragment : Fragment() {
340338
shuffleList.clear()
341339
}
342340
if (libraryViewModel.librarySongList.isNotEmpty()) {
343-
shuffleList.add(libraryViewModel.librarySongList.random())
344-
shuffleList.add(libraryViewModel.librarySongList.random())
345-
shuffleList.add(libraryViewModel.librarySongList.random())
346-
shuffleList.add(libraryViewModel.librarySongList.random())
347-
shuffleList.add(libraryViewModel.librarySongList.random())
348-
shuffleAdapter.notifyItemRangeChanged(0, 5)
341+
for (i in 1..10) {
342+
shuffleList.add(libraryViewModel.librarySongList.random())
343+
}
344+
shuffleAdapter.notifyItemRangeChanged(0, 10)
349345
}
350346
}
351347
}

0 commit comments

Comments
 (0)