diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeNavigationBarItem.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeNavigationBarItem.kt index 5254648f24..328661c834 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeNavigationBarItem.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeNavigationBarItem.kt @@ -16,18 +16,18 @@ enum class HomeNavigationBarItem( val labelRes: Int, ) { Chats( - labelRes = R.string.screen_roomlist_main_space_title + labelRes = R.string.screen_home_tab_chats ), Spaces( - // TODO Create a new entry in Localazy - labelRes = R.string.screen_roomlist_main_space_title + labelRes = R.string.screen_home_tab_spaces ); @Composable - fun icon() = when (this) { - Chats -> CompoundIcons.ChatSolid() - // TODO Spaces -> CompoundIcons.Workspace() - Spaces -> CompoundIcons.Code() + fun icon( + isSelected: Boolean, + ) = when (this) { + Chats -> if (isSelected) CompoundIcons.ChatSolid() else CompoundIcons.Chat() + Spaces -> if (isSelected) CompoundIcons.WorkspaceSolid() else CompoundIcons.Workspace() } companion object { 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 fb5b9c9ae3..f80ee381c3 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 @@ -56,7 +56,9 @@ import io.element.android.libraries.designsystem.preview.PreviewsDayNight import io.element.android.libraries.designsystem.theme.components.FloatingActionButton import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.NavigationBar +import io.element.android.libraries.designsystem.theme.components.NavigationBarIcon import io.element.android.libraries.designsystem.theme.components.NavigationBarItem +import io.element.android.libraries.designsystem.theme.components.NavigationBarText import io.element.android.libraries.designsystem.theme.components.Scaffold import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.utils.snackbar.SnackbarHost @@ -192,19 +194,21 @@ private fun HomeScaffold( ) ) { HomeNavigationBarItem.entries.forEach { item -> + val isSelected = state.currentHomeNavigationBarItem == item NavigationBarItem( - selected = state.currentHomeNavigationBarItem == item, + selected = isSelected, onClick = { state.eventSink(HomeEvents.SelectHomeNavigationBarItem(item)) }, icon = { - Icon( - imageVector = item.icon(), - contentDescription = null + NavigationBarIcon( + imageVector = item.icon(isSelected), ) }, label = { - Text(stringResource(item.labelRes)) + NavigationBarText( + text = stringResource(item.labelRes), + ) } ) } diff --git a/features/home/impl/src/main/res/values/localazy.xml b/features/home/impl/src/main/res/values/localazy.xml index 58afb06591..f2d2e9c441 100644 --- a/features/home/impl/src/main/res/values/localazy.xml +++ b/features/home/impl/src/main/res/values/localazy.xml @@ -12,6 +12,8 @@ "Your key storage is out of sync" "To ensure you never miss an important call, please change your settings to allow full-screen notifications when your phone is locked." "Enhance your call experience" + "Chats" + "Spaces" "Are you sure you want to decline the invitation to join %1$s?" "Decline invite" "Are you sure you want to decline this private chat with %1$s?" diff --git a/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Day_3_en.png b/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Day_3_en.png index 5216e4a4fd..cccc8ba9dd 100644 --- a/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Day_3_en.png +++ b/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Day_3_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cc132c097ec62633e72292861654fa825f1962eacf8cdcea9553aa0475e2e2fd -size 68790 +oid sha256:cd2c43ded5f2b8ee72e56476a6f84105675b19cd35d0338ec316012b2e732e45 +size 69332 diff --git a/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Day_4_en.png b/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Day_4_en.png index f5e553861e..509ca1c24c 100644 --- a/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Day_4_en.png +++ b/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Day_4_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6766c513026e13417d0371f196d69b712a900feeb1f814cda14ba34df188c73a -size 23921 +oid sha256:b42d23bee432b2713fbfebb00ccf5272625a0f57e4f74be2cedb6f1ee009fd4a +size 25675 diff --git a/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Night_3_en.png b/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Night_3_en.png index f51729e646..2598472959 100644 --- a/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Night_3_en.png +++ b/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Night_3_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3dde30b95371e46ad6d36dfd7c95e2a1e6968517d75b11d16512d5ac53337bb0 -size 65102 +oid sha256:d6e25cc2f51622fadf6b837a85aa6c929b49bf3f34900d739bc14c599627a280 +size 65604 diff --git a/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Night_4_en.png b/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Night_4_en.png index 35f9e77b2a..3292130289 100644 --- a/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Night_4_en.png +++ b/tests/uitests/src/test/snapshots/images/features.home.impl_HomeView_Night_4_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d6454d10e26c7c1ffb14931c38af49ce025a5c0853930c1cddf1f7b2b5e1967 -size 21562 +oid sha256:f4e5b98d04c66b0da10de45528cb4d953e778734a7de3d5b5e53985c4f496d74 +size 23429 diff --git a/tools/localazy/config.json b/tools/localazy/config.json index 9d8d1f09b7..9044372ff0 100644 --- a/tools/localazy/config.json +++ b/tools/localazy/config.json @@ -164,6 +164,7 @@ { "name" : ":features:home:impl", "includeRegex" : [ + "screen\\.home\\..*", "screen_roomlist_.*", "screen\\.roomlist\\..*", "session_verification_banner_.*",