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:
Benoit Marty 2025-09-11 17:29:15 +02:00 committed by GitHub
commit 3af4405ee3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 1840 additions and 286 deletions

View file

@ -0,0 +1,46 @@
/*
* 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.previewutils.room
import io.element.android.libraries.matrix.api.core.RoomAlias
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
import io.element.android.libraries.matrix.api.spaces.SpaceRoom
import io.element.android.libraries.matrix.api.user.MatrixUser
fun aSpaceRoom(
name: String? = "Space name",
avatarUrl: String? = null,
canonicalAlias: RoomAlias? = null,
childrenCount: Int = 0,
guestCanJoin: Boolean = false,
heroes: List<MatrixUser> = emptyList(),
joinRule: JoinRule? = null,
numJoinedMembers: Int = 0,
roomId: RoomId = RoomId("!roomId:example.com"),
roomType: RoomType = RoomType.Space,
state: CurrentUserMembership? = null,
topic: String? = null,
worldReadable: Boolean = false,
) = SpaceRoom(
name = name,
avatarUrl = avatarUrl,
canonicalAlias = canonicalAlias,
childrenCount = childrenCount,
guestCanJoin = guestCanJoin,
heroes = heroes,
joinRule = joinRule,
numJoinedMembers = numJoinedMembers,
roomId = roomId,
roomType = roomType,
state = state,
topic = topic,
worldReadable = worldReadable
)