From 296b85eb2f16d01a21d94ed3b861ebdfe74fd0c5 Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 23 Oct 2025 16:11:26 +0200 Subject: [PATCH] design(home): rename RomListTopBar to HomeTopBar --- .../android/features/home/impl/HomeView.kt | 4 ++-- .../{RoomListTopBar.kt => HomeTopBar.kt} | 18 +++++++++--------- .../tests/konsist/KonsistPreviewTest.kt | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) rename features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/{RoomListTopBar.kt => HomeTopBar.kt} (97%) diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeView.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeView.kt index 563f9c86c4..2b407bb49b 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeView.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeView.kt @@ -41,7 +41,7 @@ import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons import io.element.android.features.home.impl.components.RoomListContentView import io.element.android.features.home.impl.components.RoomListMenuAction -import io.element.android.features.home.impl.components.RoomListTopBar +import io.element.android.features.home.impl.components.HomeTopBar import io.element.android.features.home.impl.model.RoomListRoomSummary import io.element.android.features.home.impl.roomlist.RoomListContextMenu import io.element.android.features.home.impl.roomlist.RoomListDeclineInviteMenu @@ -158,7 +158,7 @@ private fun HomeScaffold( Scaffold( modifier = modifier.nestedScroll(scrollBehavior.nestedScrollConnection), topBar = { - RoomListTopBar( + HomeTopBar( title = stringResource(state.currentHomeNavigationBarItem.labelRes), currentUserAndNeighbors = state.currentUserAndNeighbors, showAvatarIndicator = state.showAvatarIndicator, diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/RoomListTopBar.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/HomeTopBar.kt similarity index 97% rename from features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/RoomListTopBar.kt rename to features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/HomeTopBar.kt index abd6e7892d..f2a712ef66 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/RoomListTopBar.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/HomeTopBar.kt @@ -76,7 +76,7 @@ import kotlinx.collections.immutable.toImmutableList @OptIn(ExperimentalMaterial3Api::class) @Composable -fun RoomListTopBar( +fun HomeTopBar( title: String, currentUserAndNeighbors: ImmutableList, showAvatarIndicator: Boolean, @@ -92,7 +92,7 @@ fun RoomListTopBar( canReportBug: Boolean, modifier: Modifier = Modifier, ) { - DefaultRoomListTopBar( + DefaultHomeTopBar( title = title, currentUserAndNeighbors = currentUserAndNeighbors, showAvatarIndicator = showAvatarIndicator, @@ -112,7 +112,7 @@ fun RoomListTopBar( @OptIn(ExperimentalMaterial3Api::class) @Composable -private fun DefaultRoomListTopBar( +private fun DefaultHomeTopBar( title: String, currentUserAndNeighbors: ImmutableList, showAvatarIndicator: Boolean, @@ -329,8 +329,8 @@ private fun AccountIcon( @OptIn(ExperimentalMaterial3Api::class) @PreviewsDayNight @Composable -internal fun DefaultRoomListTopBarPreview() = ElementPreview { - DefaultRoomListTopBar( +internal fun DefaultHomeTopBarPreview() = ElementPreview { + DefaultHomeTopBar( title = stringResource(R.string.screen_roomlist_main_space_title), currentUserAndNeighbors = persistentListOf(MatrixUser(UserId("@id:domain"), "Alice")), showAvatarIndicator = false, @@ -350,8 +350,8 @@ internal fun DefaultRoomListTopBarPreview() = ElementPreview { @OptIn(ExperimentalMaterial3Api::class) @PreviewsDayNight @Composable -internal fun DefaultRoomListTopBarWithIndicatorPreview() = ElementPreview { - DefaultRoomListTopBar( +internal fun DefaultHomeTopBarWithIndicatorPreview() = ElementPreview { + DefaultHomeTopBar( title = stringResource(R.string.screen_roomlist_main_space_title), currentUserAndNeighbors = persistentListOf(MatrixUser(UserId("@id:domain"), "Alice")), showAvatarIndicator = true, @@ -371,8 +371,8 @@ internal fun DefaultRoomListTopBarWithIndicatorPreview() = ElementPreview { @OptIn(ExperimentalMaterial3Api::class) @PreviewsDayNight @Composable -internal fun DefaultRoomListTopBarMultiAccountPreview() = ElementPreview { - DefaultRoomListTopBar( +internal fun DefaultHomeTopBarMultiAccountPreview() = ElementPreview { + DefaultHomeTopBar( title = stringResource(R.string.screen_roomlist_main_space_title), currentUserAndNeighbors = aMatrixUserList().take(3).toImmutableList(), showAvatarIndicator = false, diff --git a/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistPreviewTest.kt b/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistPreviewTest.kt index 8120e2ff2e..e027200bfc 100644 --- a/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistPreviewTest.kt +++ b/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistPreviewTest.kt @@ -81,8 +81,8 @@ class KonsistPreviewTest { "BackgroundVerticalGradientDisabledPreview", "BackgroundVerticalGradientPreview", "ColorAliasesPreview", - "DefaultRoomListTopBarMultiAccountPreview", - "DefaultRoomListTopBarWithIndicatorPreview", + "DefaultHomeTopBarMultiAccountPreview", + "DefaultHomeTopBarWithIndicatorPreview", "FocusedEventPreview", "GradientFloatingActionButtonCircleShapePreview", "HeaderFooterPageScrollablePreview",