mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
+56
-47
@@ -80,7 +80,6 @@ import io.element.android.libraries.designsystem.modifiers.backgroundVerticalGra
|
|||||||
import io.element.android.libraries.designsystem.preview.ElementPreview
|
import io.element.android.libraries.designsystem.preview.ElementPreview
|
||||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||||
import io.element.android.libraries.designsystem.preview.USER_NAME_ALICE
|
import io.element.android.libraries.designsystem.preview.USER_NAME_ALICE
|
||||||
import io.element.android.libraries.designsystem.theme.aliasScreenTitle
|
|
||||||
import io.element.android.libraries.designsystem.theme.components.DropdownMenu
|
import io.element.android.libraries.designsystem.theme.components.DropdownMenu
|
||||||
import io.element.android.libraries.designsystem.theme.components.DropdownMenuItem
|
import io.element.android.libraries.designsystem.theme.components.DropdownMenuItem
|
||||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||||
@@ -141,15 +140,23 @@ fun HomeTopBar(
|
|||||||
else -> stringResource(selectedNavigationItem.labelRes)
|
else -> stringResource(selectedNavigationItem.labelRes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HomeNavigationBarItem.Spaces -> stringResource(selectedNavigationItem.labelRes)
|
HomeNavigationBarItem.Spaces -> null
|
||||||
|
}
|
||||||
|
displayTitle?.let {
|
||||||
|
val style = when (spaceFiltersState) {
|
||||||
|
// Space name
|
||||||
|
is SpaceFiltersState.Selected -> ElementTheme.typography.fontHeadingSmMedium
|
||||||
|
// "Chats"
|
||||||
|
else -> ElementTheme.typography.fontHeadingLgBold
|
||||||
|
}
|
||||||
|
Text(
|
||||||
|
modifier = Modifier.semantics {
|
||||||
|
heading()
|
||||||
|
},
|
||||||
|
style = style,
|
||||||
|
text = displayTitle,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Text(
|
|
||||||
modifier = Modifier.semantics {
|
|
||||||
heading()
|
|
||||||
},
|
|
||||||
style = ElementTheme.typography.aliasScreenTitle,
|
|
||||||
text = displayTitle,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
NavigationIcon(
|
NavigationIcon(
|
||||||
@@ -179,7 +186,9 @@ fun HomeTopBar(
|
|||||||
TopAppBarScrollBehaviorLayout(scrollBehavior = scrollBehavior) {
|
TopAppBarScrollBehaviorLayout(scrollBehavior = scrollBehavior) {
|
||||||
RoomListFiltersView(
|
RoomListFiltersView(
|
||||||
state = filtersState,
|
state = filtersState,
|
||||||
modifier = Modifier.padding(bottom = 16.dp).padding(contentPadding)
|
modifier = Modifier
|
||||||
|
.padding(bottom = 16.dp)
|
||||||
|
.padding(contentPadding)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -348,45 +357,45 @@ private fun AccountIcon(
|
|||||||
),
|
),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
val avatarData by remember(matrixUser) {
|
val avatarData by remember(matrixUser) {
|
||||||
derivedStateOf {
|
derivedStateOf {
|
||||||
matrixUser.getAvatarData(size = AvatarSize.CurrentUserTopBar)
|
matrixUser.getAvatarData(size = AvatarSize.CurrentUserTopBar)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
val statusEmoji = matrixUser.displayedStatus?.toEmojiText()
|
}
|
||||||
val avatarModifier = if (statusEmoji != null) {
|
val statusEmoji = matrixUser.displayedStatus?.toEmojiText()
|
||||||
Modifier.eraseStatusEmojiBackground(
|
val avatarModifier = if (statusEmoji != null) {
|
||||||
parentSize = AvatarSize.CurrentUserTopBar.dp,
|
Modifier.eraseStatusEmojiBackground(
|
||||||
layoutDirection = LocalLayoutDirection.current,
|
parentSize = AvatarSize.CurrentUserTopBar.dp,
|
||||||
)
|
layoutDirection = LocalLayoutDirection.current,
|
||||||
} else {
|
|
||||||
Modifier
|
|
||||||
}
|
|
||||||
Avatar(
|
|
||||||
avatarData = avatarData,
|
|
||||||
avatarType = AvatarType.User,
|
|
||||||
modifier = avatarModifier,
|
|
||||||
contentDescription = if (isCurrentAccount) {
|
|
||||||
if (showAvatarIndicator) {
|
|
||||||
stringResource(CommonStrings.a11y_settings_with_required_action)
|
|
||||||
} else {
|
|
||||||
stringResource(CommonStrings.common_settings)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
null
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
if (statusEmoji != null) {
|
} else {
|
||||||
StatusEmojiBadge(
|
Modifier
|
||||||
emoji = statusEmoji,
|
}
|
||||||
modifier = Modifier.align(Alignment.BottomEnd),
|
Avatar(
|
||||||
)
|
avatarData = avatarData,
|
||||||
}
|
avatarType = AvatarType.User,
|
||||||
if (showAvatarIndicator) {
|
modifier = avatarModifier,
|
||||||
RedIndicatorAtom(
|
contentDescription = if (isCurrentAccount) {
|
||||||
modifier = Modifier.align(Alignment.TopEnd)
|
if (showAvatarIndicator) {
|
||||||
)
|
stringResource(CommonStrings.a11y_settings_with_required_action)
|
||||||
}
|
} else {
|
||||||
|
stringResource(CommonStrings.common_settings)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
},
|
||||||
|
)
|
||||||
|
if (statusEmoji != null) {
|
||||||
|
StatusEmojiBadge(
|
||||||
|
emoji = statusEmoji,
|
||||||
|
modifier = Modifier.align(Alignment.BottomEnd),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (showAvatarIndicator) {
|
||||||
|
RedIndicatorAtom(
|
||||||
|
modifier = Modifier.align(Alignment.TopEnd)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -10,6 +10,7 @@ package io.element.android.libraries.designsystem.atomic.atoms
|
|||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontStyle
|
import androidx.compose.ui.text.font.FontStyle
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import io.element.android.compound.theme.ElementTheme
|
import io.element.android.compound.theme.ElementTheme
|
||||||
@@ -20,11 +21,12 @@ fun RoomPreviewTitleAtom(
|
|||||||
title: String,
|
title: String,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
fontStyle: FontStyle? = null,
|
fontStyle: FontStyle? = null,
|
||||||
|
style: TextStyle = ElementTheme.typography.fontHeadingLgBold
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
text = title,
|
text = title,
|
||||||
style = ElementTheme.typography.fontHeadingLgBold,
|
style = style,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
fontStyle = fontStyle,
|
fontStyle = fontStyle,
|
||||||
color = ElementTheme.colors.textPrimary,
|
color = ElementTheme.colors.textPrimary,
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ fun SpaceHeaderRootView(
|
|||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(CommonStrings.screen_space_list_title),
|
text = stringResource(CommonStrings.screen_space_list_title),
|
||||||
style = ElementTheme.typography.fontHeadingLgBold,
|
style = ElementTheme.typography.fontHeadingMdBold,
|
||||||
color = ElementTheme.colors.textPrimary,
|
color = ElementTheme.colors.textPrimary,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
)
|
)
|
||||||
|
|||||||
+7
-2
@@ -19,6 +19,7 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.text.font.FontStyle
|
import androidx.compose.ui.text.font.FontStyle
|
||||||
import androidx.compose.ui.tooling.preview.datasource.LoremIpsum
|
import androidx.compose.ui.tooling.preview.datasource.LoremIpsum
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import io.element.android.compound.theme.ElementTheme
|
||||||
import io.element.android.libraries.designsystem.atomic.atoms.RoomPreviewAliasAtom
|
import io.element.android.libraries.designsystem.atomic.atoms.RoomPreviewAliasAtom
|
||||||
import io.element.android.libraries.designsystem.atomic.atoms.RoomPreviewDescriptionAtom
|
import io.element.android.libraries.designsystem.atomic.atoms.RoomPreviewDescriptionAtom
|
||||||
import io.element.android.libraries.designsystem.atomic.atoms.RoomPreviewTitleAtom
|
import io.element.android.libraries.designsystem.atomic.atoms.RoomPreviewTitleAtom
|
||||||
@@ -68,11 +69,15 @@ fun SpaceHeaderView(
|
|||||||
},
|
},
|
||||||
title = {
|
title = {
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
RoomPreviewTitleAtom(title = name)
|
RoomPreviewTitleAtom(
|
||||||
|
title = name,
|
||||||
|
style = ElementTheme.typography.fontHeadingMdBold,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
RoomPreviewTitleAtom(
|
RoomPreviewTitleAtom(
|
||||||
title = stringResource(id = CommonStrings.common_no_space_name),
|
title = stringResource(id = CommonStrings.common_no_space_name),
|
||||||
fontStyle = FontStyle.Italic
|
fontStyle = FontStyle.Italic,
|
||||||
|
style = ElementTheme.typography.fontHeadingMdBold,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user