mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
RoomList: update LoadingState and fix a crash
This commit is contained in:
+4
-6
@@ -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)
|
||||
|
||||
+2
-2
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user