Space list (#5320)
* feature(spaces) : introduce SpaceRoomList matrix api * feature (space) : extract SpaceRoomItemView * feature(spaces) : start introducing SpaceScreen * feature (space) : iterate on space list (and space screen) * feature (space) : add space cache and navigation to sub space/room * feature (space) : display top bar title * Code cleanup, remove dead code and fix compilation issue * More compilation fixes. * Update screenshots * Fix test compilation issues. * Introduce MatrixClient.rememberHideInvitesAvatar() extension to reduce code duplication. * Add test on SpacePresenter * Add test on SpaceRoomCache and fix implementation * Iterate on SpaceRoomCache thanks to SpaceRoomCacheTest * Add UT on SpaceListUpdateProcessor * Fix quality issue. * Add tests on RustSpaceRoomList --------- Co-authored-by: ganfra <francoisg@matrix.org> Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
commit
3af4405ee3
65 changed files with 1840 additions and 286 deletions
|
|
@ -20,5 +20,3 @@ value class RoomId(val value: String) : Serializable {
|
|||
|
||||
override fun toString(): String = value
|
||||
}
|
||||
|
||||
fun RoomId.toSpaceId(): SpaceId = SpaceId(this.value)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
package io.element.android.libraries.matrix.api.spaces
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.RoomAlias
|
||||
import io.element.android.libraries.matrix.api.core.SpaceId
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.room.CurrentUserMembership
|
||||
import io.element.android.libraries.matrix.api.room.RoomType
|
||||
import io.element.android.libraries.matrix.api.room.join.JoinRule
|
||||
|
|
@ -23,9 +23,11 @@ data class SpaceRoom(
|
|||
val heroes: List<MatrixUser>,
|
||||
val joinRule: JoinRule?,
|
||||
val numJoinedMembers: Int,
|
||||
val spaceId: SpaceId,
|
||||
val roomId: RoomId,
|
||||
val roomType: RoomType,
|
||||
val state: CurrentUserMembership?,
|
||||
val topic: String?,
|
||||
val worldReadable: Boolean,
|
||||
)
|
||||
) {
|
||||
val isSpace = roomType == RoomType.Space
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright 2025 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.api.spaces
|
||||
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
interface SpaceRoomList {
|
||||
sealed interface PaginationStatus {
|
||||
data object Loading : PaginationStatus
|
||||
data class Idle(val hasMoreToLoad: Boolean) : PaginationStatus
|
||||
}
|
||||
|
||||
fun currentSpaceFlow(): Flow<SpaceRoom?>
|
||||
|
||||
val spaceRoomsFlow: Flow<List<SpaceRoom>>
|
||||
val paginationStatusFlow: StateFlow<PaginationStatus>
|
||||
suspend fun paginate(): Result<Unit>
|
||||
}
|
||||
|
|
@ -7,9 +7,12 @@
|
|||
|
||||
package io.element.android.libraries.matrix.api.spaces
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import kotlinx.coroutines.flow.SharedFlow
|
||||
|
||||
interface SpaceService {
|
||||
val spaceRooms: SharedFlow<List<SpaceRoom>>
|
||||
val spaceRoomsFlow: SharedFlow<List<SpaceRoom>>
|
||||
suspend fun joinedSpaces(): Result<List<SpaceRoom>>
|
||||
|
||||
fun spaceRoomList(id: RoomId): SpaceRoomList
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue