RoomList: update LoadingState and fix a crash
This commit is contained in:
parent
8c66924be9
commit
19e2c104af
5 changed files with 45 additions and 20 deletions
|
|
@ -20,14 +20,12 @@ import kotlinx.coroutines.flow.StateFlow
|
|||
|
||||
interface RoomSummaryDataSource {
|
||||
|
||||
enum class LoadingState {
|
||||
NotLoaded,
|
||||
PreLoaded,
|
||||
PartiallyLoaded,
|
||||
FullyLoaded,
|
||||
sealed class LoadingState {
|
||||
object NotLoaded : LoadingState()
|
||||
data class Loaded(val numberOfRooms: Int): LoadingState()
|
||||
}
|
||||
|
||||
fun loadingState(): StateFlow<LoadingState>
|
||||
fun allRoomsLoadingState(): StateFlow<LoadingState>
|
||||
fun allRooms(): StateFlow<List<RoomSummary>>
|
||||
fun inviteRooms(): StateFlow<List<RoomSummary>>
|
||||
fun updateRoomListVisibleRange(range: IntRange)
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ interface SyncService {
|
|||
/**
|
||||
* Tries to start the sync. If already syncing it has no effect.
|
||||
*/
|
||||
fun startSync()
|
||||
fun startSync(): Result<Unit>
|
||||
|
||||
/**
|
||||
* Tries to stop the sync. If service is not syncing it has no effect.
|
||||
*/
|
||||
fun stopSync()
|
||||
fun stopSync(): Result<Unit>
|
||||
|
||||
/**
|
||||
* Flow of [SyncState]. Will be updated as soon as the current [SyncState] changes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue