Tim Malseed
09/30/2020, 5:08 AMfun findSongs(): Flow<Pair<Song, Int>>
Where the flow emits a song, and a count of the total number of songs..
It seems a little redundant to have to emit the same ‘total’ each time. But the alternative is to have a separate function for retrieving the count, and thats’ not particularly efficient..Tim Malseed
09/30/2020, 5:31 AMfun findSongs(progress: (Int, Int) -> (Unit)): Flow<Song>
coroutinedispatcher
09/30/2020, 6:31 AMonEach
song that you get and map in the other step.Tim Malseed
09/30/2020, 6:49 AMcoroutinedispatcher
09/30/2020, 6:55 AMgetSongs().onEach{ -> Pair(a,c++)}.collect/map
Tim Malseed
09/30/2020, 6:56 AMcoroutinedispatcher
09/30/2020, 6:56 AMTim Malseed
09/30/2020, 6:56 AMcoroutinedispatcher
09/30/2020, 6:57 AMTim Malseed
09/30/2020, 6:57 AMTim Malseed
09/30/2020, 6:58 AMsuspend fun findSongs(callback: ((song: Song, progress: Int, total: Int) -> (Unit))? = null): List<Song>
Tim Malseed
09/30/2020, 6:58 AMTim Malseed
09/30/2020, 6:59 AMtaer
09/30/2020, 1:41 PMaraqnid
09/30/2020, 5:37 PMaraqnid
09/30/2020, 5:38 PMTim Malseed
10/01/2020, 12:00 AMTim Malseed
10/01/2020, 12:01 AMtaer
10/01/2020, 1:29 PMtaer
10/01/2020, 1:32 PMTim Malseed
10/01/2020, 11:12 PMTim Malseed
10/02/2020, 12:17 AM