Merge pull request #4990 from element-hq/feature/bma/workspaceIcon
Home navigation bar fixes
This commit is contained in:
commit
370c8ed752
8 changed files with 27 additions and 20 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
<string name="confirm_recovery_key_banner_title">"Your key storage is out of sync"</string>
|
||||
<string name="full_screen_intent_banner_message">"To ensure you never miss an important call, please change your settings to allow full-screen notifications when your phone is locked."</string>
|
||||
<string name="full_screen_intent_banner_title">"Enhance your call experience"</string>
|
||||
<string name="screen_home_tab_chats">"Chats"</string>
|
||||
<string name="screen_home_tab_spaces">"Spaces"</string>
|
||||
<string name="screen_invites_decline_chat_message">"Are you sure you want to decline the invitation to join %1$s?"</string>
|
||||
<string name="screen_invites_decline_chat_title">"Decline invite"</string>
|
||||
<string name="screen_invites_decline_direct_chat_message">"Are you sure you want to decline this private chat with %1$s?"</string>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cc132c097ec62633e72292861654fa825f1962eacf8cdcea9553aa0475e2e2fd
|
||||
size 68790
|
||||
oid sha256:cd2c43ded5f2b8ee72e56476a6f84105675b19cd35d0338ec316012b2e732e45
|
||||
size 69332
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6766c513026e13417d0371f196d69b712a900feeb1f814cda14ba34df188c73a
|
||||
size 23921
|
||||
oid sha256:b42d23bee432b2713fbfebb00ccf5272625a0f57e4f74be2cedb6f1ee009fd4a
|
||||
size 25675
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3dde30b95371e46ad6d36dfd7c95e2a1e6968517d75b11d16512d5ac53337bb0
|
||||
size 65102
|
||||
oid sha256:d6e25cc2f51622fadf6b837a85aa6c929b49bf3f34900d739bc14c599627a280
|
||||
size 65604
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6d6454d10e26c7c1ffb14931c38af49ce025a5c0853930c1cddf1f7b2b5e1967
|
||||
size 21562
|
||||
oid sha256:f4e5b98d04c66b0da10de45528cb4d953e778734a7de3d5b5e53985c4f496d74
|
||||
size 23429
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@
|
|||
{
|
||||
"name" : ":features:home:impl",
|
||||
"includeRegex" : [
|
||||
"screen\\.home\\..*",
|
||||
"screen_roomlist_.*",
|
||||
"screen\\.roomlist\\..*",
|
||||
"session_verification_banner_.*",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue