mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Rework: extract sub fun composable.
This commit is contained in:
+23
-18
@@ -209,12 +209,7 @@ private fun RowScope.NotificationIcons(
|
|||||||
null,
|
null,
|
||||||
RoomNotificationMode.ALL_MESSAGES -> {
|
RoomNotificationMode.ALL_MESSAGES -> {
|
||||||
if (numberOfUnreadMentions > 0) {
|
if (numberOfUnreadMentions > 0) {
|
||||||
Icon(
|
MentionIndicatorAtom()
|
||||||
modifier = Modifier.size(16.dp),
|
|
||||||
contentDescription = null,
|
|
||||||
imageVector = CompoundIcons.Mention,
|
|
||||||
tint = ElementTheme.colors.unreadIndicator,
|
|
||||||
)
|
|
||||||
UnreadIndicatorAtom()
|
UnreadIndicatorAtom()
|
||||||
} else if (numberOfUnreadMessages > 0) {
|
} else if (numberOfUnreadMessages > 0) {
|
||||||
UnreadIndicatorAtom()
|
UnreadIndicatorAtom()
|
||||||
@@ -222,24 +217,14 @@ private fun RowScope.NotificationIcons(
|
|||||||
}
|
}
|
||||||
RoomNotificationMode.MENTIONS_AND_KEYWORDS_ONLY -> {
|
RoomNotificationMode.MENTIONS_AND_KEYWORDS_ONLY -> {
|
||||||
if (numberOfUnreadMentions > 0) {
|
if (numberOfUnreadMentions > 0) {
|
||||||
Icon(
|
MentionIndicatorAtom()
|
||||||
modifier = Modifier.size(16.dp),
|
|
||||||
contentDescription = null,
|
|
||||||
imageVector = CompoundIcons.Mention,
|
|
||||||
tint = ElementTheme.colors.unreadIndicator,
|
|
||||||
)
|
|
||||||
UnreadIndicatorAtom()
|
UnreadIndicatorAtom()
|
||||||
} else if (numberOfUnreadMessages > 0) {
|
} else if (numberOfUnreadMessages > 0) {
|
||||||
UnreadIndicatorAtom(color = ElementTheme.colors.iconQuaternary)
|
UnreadIndicatorAtom(color = ElementTheme.colors.iconQuaternary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RoomNotificationMode.MUTE -> {
|
RoomNotificationMode.MUTE -> {
|
||||||
Icon(
|
NotificationOffIndicatorAtom()
|
||||||
modifier = Modifier.size(16.dp),
|
|
||||||
contentDescription = null,
|
|
||||||
imageVector = CompoundIcons.NotificationsSolidOff,
|
|
||||||
tint = ElementTheme.colors.iconQuaternary,
|
|
||||||
)
|
|
||||||
if (numberOfUnreadMessages > 0 || numberOfUnreadMentions > 0) {
|
if (numberOfUnreadMessages > 0 || numberOfUnreadMentions > 0) {
|
||||||
UnreadIndicatorAtom(color = ElementTheme.colors.iconQuaternary)
|
UnreadIndicatorAtom(color = ElementTheme.colors.iconQuaternary)
|
||||||
}
|
}
|
||||||
@@ -247,6 +232,26 @@ private fun RowScope.NotificationIcons(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun NotificationOffIndicatorAtom() {
|
||||||
|
Icon(
|
||||||
|
modifier = Modifier.size(16.dp),
|
||||||
|
contentDescription = null,
|
||||||
|
imageVector = CompoundIcons.NotificationsSolidOff,
|
||||||
|
tint = ElementTheme.colors.iconQuaternary,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun MentionIndicatorAtom() {
|
||||||
|
Icon(
|
||||||
|
modifier = Modifier.size(16.dp),
|
||||||
|
contentDescription = null,
|
||||||
|
imageVector = CompoundIcons.Mention,
|
||||||
|
tint = ElementTheme.colors.unreadIndicator,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@PreviewsDayNight
|
@PreviewsDayNight
|
||||||
@Composable
|
@Composable
|
||||||
internal fun RoomSummaryRowPreview(@PreviewParameter(RoomListRoomSummaryProvider::class) data: RoomListRoomSummary) = ElementPreview {
|
internal fun RoomSummaryRowPreview(@PreviewParameter(RoomListRoomSummaryProvider::class) data: RoomListRoomSummary) = ElementPreview {
|
||||||
|
|||||||
Reference in New Issue
Block a user