forked from melod1n/fast-messenger
update and refresh icons to Material Symbols;
update MaterialDialog style
This commit is contained in:
+11
-11
@@ -14,22 +14,22 @@ sealed class MessageOption(
|
||||
|
||||
data object Retry : MessageOption(
|
||||
titleResId = R.string.message_context_action_retry,
|
||||
iconResId = R.drawable.round_restart_alt_24
|
||||
iconResId = R.drawable.ic_restart_alt_round_24
|
||||
)
|
||||
|
||||
data object Reply : MessageOption(
|
||||
titleResId = R.string.message_context_action_reply,
|
||||
iconResId = R.drawable.round_reply_24
|
||||
iconResId = R.drawable.ic_reply_round_24
|
||||
)
|
||||
|
||||
data object ForwardHere : MessageOption(
|
||||
titleResId = R.string.message_context_action_forward_here,
|
||||
iconResId = R.drawable.round_reply_all_24
|
||||
iconResId = R.drawable.ic_reply_all_round_24
|
||||
)
|
||||
|
||||
data object Forward : MessageOption(
|
||||
titleResId = R.string.message_context_action_forward,
|
||||
iconResId = R.drawable.round_forward_24
|
||||
iconResId = R.drawable.ic_forward_round_24
|
||||
)
|
||||
|
||||
data object Pin : MessageOption(
|
||||
@@ -44,37 +44,37 @@ sealed class MessageOption(
|
||||
|
||||
data object Read : MessageOption(
|
||||
titleResId = R.string.message_context_action_read,
|
||||
iconResId = R.drawable.round_mark_email_read_24
|
||||
iconResId = R.drawable.ic_done_all_round_24
|
||||
)
|
||||
|
||||
data object Copy : MessageOption(
|
||||
titleResId = R.string.message_context_action_copy,
|
||||
iconResId = R.drawable.round_content_copy_24
|
||||
iconResId = R.drawable.ic_content_copy_round_24
|
||||
)
|
||||
|
||||
data object MarkAsImportant : MessageOption(
|
||||
titleResId = R.string.message_context_action_mark_as_important,
|
||||
iconResId = R.drawable.round_star_24
|
||||
iconResId = R.drawable.ic_star_round_24
|
||||
)
|
||||
|
||||
data object UnmarkAsImportant : MessageOption(
|
||||
titleResId = R.string.message_context_action_unmark_as_important,
|
||||
iconResId = R.drawable.round_star_outline_24
|
||||
iconResId = R.drawable.ic_star_round_24
|
||||
)
|
||||
|
||||
data object MarkAsSpam : MessageOption(
|
||||
titleResId = R.string.message_context_action_mark_as_spam,
|
||||
iconResId = R.drawable.round_report_gmailerrorred_24
|
||||
iconResId = R.drawable.ic_report_round_24
|
||||
)
|
||||
|
||||
data object UnmarkAsSpam : MessageOption(
|
||||
titleResId = R.string.message_context_action_unmark_as_spam,
|
||||
iconResId = R.drawable.round_report_off_24
|
||||
iconResId = R.drawable.ic_report_off_round_24
|
||||
)
|
||||
|
||||
data object Edit : MessageOption(
|
||||
titleResId = R.string.message_context_action_edit,
|
||||
iconResId = R.drawable.round_create_24
|
||||
iconResId = R.drawable.ic_edit_round_24
|
||||
)
|
||||
|
||||
data object Delete : MessageOption(
|
||||
|
||||
+5
-5
@@ -45,7 +45,7 @@ fun BoxScope.DateStatus(
|
||||
if (isImportant) {
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_star_24),
|
||||
painter = painterResource(R.drawable.ic_star_round_24),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(14.dp)
|
||||
)
|
||||
@@ -64,7 +64,7 @@ fun BoxScope.DateStatus(
|
||||
if (isEdited) {
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_edit_24px),
|
||||
painter = painterResource(R.drawable.ic_edit_round_24),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(14.dp)
|
||||
)
|
||||
@@ -83,13 +83,13 @@ fun BoxScope.DateStatus(
|
||||
modifier = Modifier.size(14.dp),
|
||||
painter = painterResource(
|
||||
when (sendingStatus) {
|
||||
SendingStatus.SENDING -> R.drawable.round_access_time_24
|
||||
SendingStatus.SENDING -> R.drawable.ic_schedule_round_24
|
||||
SendingStatus.SENT -> {
|
||||
if (isRead) R.drawable.ic_done_all_round_24
|
||||
else R.drawable.ic_round_done_24
|
||||
else R.drawable.ic_check_round_24
|
||||
}
|
||||
|
||||
SendingStatus.FAILED -> R.drawable.round_error_outline_24
|
||||
SendingStatus.FAILED -> R.drawable.ic_error_round_24
|
||||
}
|
||||
),
|
||||
tint = if (sendingStatus == SendingStatus.FAILED) MaterialTheme.colorScheme.error
|
||||
|
||||
+6
-6
@@ -200,7 +200,7 @@ fun InputBar(
|
||||
},
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_outline_emoji_emotions_24),
|
||||
painter = painterResource(id = R.drawable.ic_sentiment_satisfied_round_24),
|
||||
contentDescription = "Emoji button",
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
@@ -291,7 +291,7 @@ fun InputBar(
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.round_attach_file_24),
|
||||
painter = painterResource(id = R.drawable.ic_attach_file_round_24),
|
||||
contentDescription = "Add attachment button",
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
@@ -325,10 +325,10 @@ fun InputBar(
|
||||
painter = painterResource(
|
||||
id = when (actionMode) {
|
||||
ActionMode.DELETE -> R.drawable.ic_delete_round_24
|
||||
ActionMode.EDIT -> R.drawable.ic_round_done_24
|
||||
ActionMode.RECORD_AUDIO -> R.drawable.ic_round_mic_none_24
|
||||
ActionMode.RECORD_VIDEO -> R.drawable.rounded_photo_camera_24
|
||||
ActionMode.SEND -> R.drawable.round_send_24
|
||||
ActionMode.EDIT -> R.drawable.ic_check_round_24
|
||||
ActionMode.RECORD_AUDIO -> R.drawable.ic_mic_round_24
|
||||
ActionMode.RECORD_VIDEO -> R.drawable.ic_photo_camera_round_24
|
||||
ActionMode.SEND -> R.drawable.ic_send_round_24
|
||||
}
|
||||
),
|
||||
contentDescription = null,
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ fun IncomingMessageBubble(
|
||||
) {
|
||||
Box(modifier = Modifier.fillMaxWidth()) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_reply_24),
|
||||
painter = painterResource(R.drawable.ic_reply_round_24),
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
modifier = Modifier
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ fun OutgoingMessageBubble(
|
||||
contentAlignment = Alignment.CenterEnd
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_reply_24),
|
||||
painter = painterResource(R.drawable.ic_reply_round_24),
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
modifier = Modifier
|
||||
|
||||
+22
-19
@@ -5,6 +5,7 @@ import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.material3.Checkbox
|
||||
@@ -170,6 +171,7 @@ fun MessageOptionsDialog(
|
||||
}
|
||||
|
||||
MaterialDialog(onDismissRequest = onDismissed) {
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
if (showReadPeers) {
|
||||
var viewCount by remember {
|
||||
mutableStateOf<Int?>(null)
|
||||
@@ -181,31 +183,32 @@ fun MessageOptionsDialog(
|
||||
|
||||
MessageOptionItem(
|
||||
title = viewCount?.let { "$it views" } ?: "...",
|
||||
iconResId = R.drawable.round_visibility_24px,
|
||||
iconResId = R.drawable.ic_visibility_round_24,
|
||||
tintColor = primaryColor,
|
||||
onClick = {}
|
||||
)
|
||||
}
|
||||
|
||||
messageOptions
|
||||
.forEachIndexed { index, (titleResId, iconResId, tintColor) ->
|
||||
MessageOptionItem(
|
||||
title = stringResource(titleResId),
|
||||
iconResId = iconResId,
|
||||
tintColor = tintColor,
|
||||
onClick = {
|
||||
onDismissed()
|
||||
val pickedOption = options[index]
|
||||
onItemPicked(
|
||||
bundleOf(
|
||||
"option" to pickedOption,
|
||||
"messageId" to message.id,
|
||||
"cmId" to message.cmId
|
||||
)
|
||||
messageOptions.forEachIndexed { index, (titleResId, iconResId, tintColor) ->
|
||||
MessageOptionItem(
|
||||
title = stringResource(titleResId),
|
||||
iconResId = iconResId,
|
||||
tintColor = tintColor,
|
||||
onClick = {
|
||||
onDismissed()
|
||||
val pickedOption = options[index]
|
||||
onItemPicked(
|
||||
bundleOf(
|
||||
"option" to pickedOption,
|
||||
"messageId" to message.id,
|
||||
"cmId" to message.cmId
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -108,7 +108,7 @@ fun MessagesHistoryTopBar(
|
||||
modifier = Modifier
|
||||
.align(Alignment.Center)
|
||||
.size(24.dp),
|
||||
painter = painterResource(id = R.drawable.ic_round_bookmark_border_24),
|
||||
painter = painterResource(id = R.drawable.ic_bookmark_round_24),
|
||||
contentDescription = "Favorites icon",
|
||||
tint = MaterialTheme.colorScheme.onPrimary
|
||||
)
|
||||
@@ -131,7 +131,7 @@ fun MessagesHistoryTopBar(
|
||||
modifier = Modifier
|
||||
.size(36.dp)
|
||||
.clip(CircleShape),
|
||||
placeholder = painterResource(id = R.drawable.ic_account_circle_cut),
|
||||
placeholder = painterResource(id = R.drawable.ic_account_circle_fill_round_24),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -158,9 +158,9 @@ fun MessagesHistoryTopBar(
|
||||
Icon(
|
||||
painter = painterResource(
|
||||
if (state) {
|
||||
R.drawable.round_arrow_back_24px
|
||||
R.drawable.ic_arrow_back_round_24
|
||||
} else {
|
||||
R.drawable.round_close_24px
|
||||
R.drawable.ic_close_round_24
|
||||
}
|
||||
),
|
||||
contentDescription = if (state) "Close button"
|
||||
@@ -181,7 +181,7 @@ fun MessagesHistoryTopBar(
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_reply_24),
|
||||
painter = painterResource(R.drawable.ic_reply_round_24),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
@@ -194,7 +194,7 @@ fun MessagesHistoryTopBar(
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_reply_all_24),
|
||||
painter = painterResource(R.drawable.ic_reply_all_round_24),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
@@ -206,7 +206,7 @@ fun MessagesHistoryTopBar(
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_forward_24),
|
||||
painter = painterResource(R.drawable.ic_forward_round_24),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
@@ -231,7 +231,7 @@ fun MessagesHistoryTopBar(
|
||||
},
|
||||
leadingIcon = {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_refresh_24px),
|
||||
painter = painterResource(R.drawable.ic_refresh_round_24),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
@@ -244,7 +244,7 @@ fun MessagesHistoryTopBar(
|
||||
onClick = { dropDownMenuExpanded = true }
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_more_vert_24px),
|
||||
painter = painterResource(R.drawable.ic_more_vert_round_24),
|
||||
contentDescription = "Options"
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ fun PinnedMessageContainer(
|
||||
onClick = onUnpinMessageButtonClicked
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_close_24px),
|
||||
painter = painterResource(R.drawable.ic_close_round_24),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.alpha(0.5f),
|
||||
)
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ fun ReplyContainer(
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_reply_24px),
|
||||
painter = painterResource(R.drawable.ic_reply_round_24),
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
@@ -90,7 +90,7 @@ fun ReplyContainer(
|
||||
onClick = onCloseClicked
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.round_close_24px),
|
||||
painter = painterResource(R.drawable.ic_close_round_24),
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ fun Audio(
|
||||
.background(MaterialTheme.colorScheme.primary)
|
||||
.size(36.dp)
|
||||
.padding(4.dp),
|
||||
painter = painterResource(R.drawable.round_fill_play_arrow_24px),
|
||||
painter = painterResource(R.drawable.ic_play_arrow_fill_round_24),
|
||||
contentDescription = null,
|
||||
tint = contentColorFor(MaterialTheme.colorScheme.primary)
|
||||
)
|
||||
|
||||
+2
-2
@@ -90,8 +90,8 @@ fun AudioMessage(
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(
|
||||
if (isPlaying) R.drawable.round_pause_24
|
||||
else R.drawable.round_fill_play_arrow_24px,
|
||||
if (isPlaying) R.drawable.ic_pause_round_24
|
||||
else R.drawable.ic_play_arrow_fill_round_24,
|
||||
),
|
||||
contentDescription = null
|
||||
)
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ fun Gift(
|
||||
horizontalArrangement = Arrangement.Center
|
||||
) {
|
||||
Icon(
|
||||
imageVector = ImageVector.vectorResource(R.drawable.ic_attachment_gift),
|
||||
imageVector = ImageVector.vectorResource(R.drawable.ic_attachment_gift_old),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(16.dp)
|
||||
)
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ fun DynamicPreviewGrid(
|
||||
) {
|
||||
Icon(
|
||||
modifier = Modifier,
|
||||
painter = painterResource(R.drawable.round_fill_play_arrow_24px),
|
||||
painter = painterResource(R.drawable.ic_play_arrow_fill_round_24),
|
||||
contentDescription = null,
|
||||
tint = Color.White
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user