mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
mobile: remove item status alerts (#2883)
This commit is contained in:
committed by
GitHub
parent
9543af4784
commit
2ab938db60
+9
-20
@@ -1740,26 +1740,15 @@ sealed class CIStatus {
|
||||
is CIStatus.Invalid -> MR.images.ic_question_mark to metaColor
|
||||
}
|
||||
|
||||
val statusText: String get() = when (this) {
|
||||
is SndNew -> generalGetString(MR.strings.item_status_snd_new_text)
|
||||
is SndSent -> generalGetString(MR.strings.item_status_snd_sent_text)
|
||||
is SndRcvd -> generalGetString(MR.strings.item_status_snd_rcvd_text)
|
||||
is SndErrorAuth -> generalGetString(MR.strings.item_status_snd_error_text)
|
||||
is SndError -> generalGetString(MR.strings.item_status_snd_error_text)
|
||||
is RcvNew -> generalGetString(MR.strings.item_status_rcv_new_text)
|
||||
is RcvRead -> generalGetString(MR.strings.item_status_rcv_read_text)
|
||||
is Invalid -> "Invalid status"
|
||||
}
|
||||
|
||||
val statusDescription: String get() = when (this) {
|
||||
is SndNew -> generalGetString(MR.strings.item_status_snd_new_desc)
|
||||
is SndSent -> generalGetString(MR.strings.item_status_snd_sent_desc)
|
||||
is SndRcvd -> generalGetString(MR.strings.item_status_snd_rcvd_desc)
|
||||
is SndErrorAuth -> generalGetString(MR.strings.item_status_snd_error_auth_desc)
|
||||
is SndError -> String.format(generalGetString(MR.strings.item_status_snd_error_unexpected_desc), this.agentError)
|
||||
is RcvNew -> generalGetString(MR.strings.item_status_rcv_new_desc)
|
||||
is RcvRead -> generalGetString(MR.strings.item_status_rcv_read_desc)
|
||||
is Invalid -> this.text
|
||||
val statusInto: Pair<String, String>? get() = when (this) {
|
||||
is SndNew -> null
|
||||
is SndSent -> null
|
||||
is SndRcvd -> null
|
||||
is SndErrorAuth -> generalGetString(MR.strings.message_delivery_error_title) to generalGetString(MR.strings.message_delivery_error_desc)
|
||||
is SndError -> generalGetString(MR.strings.message_delivery_error_title) to (generalGetString(MR.strings.unknown_error) + ": $agentError")
|
||||
is RcvNew -> null
|
||||
is RcvRead -> null
|
||||
is Invalid -> "Invalid status" to this.text
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-28
@@ -234,18 +234,17 @@ fun ChatItemInfoView(chatModel: ChatModel, ci: ChatItem, ciInfo: ChatItemInfo, d
|
||||
)
|
||||
Spacer(Modifier.fillMaxWidth().weight(1f))
|
||||
val statusIcon = status.statusIcon(MaterialTheme.colors.primary, CurrentColors.value.colors.secondary)
|
||||
Box(
|
||||
Modifier
|
||||
.size(36.dp)
|
||||
.clip(RoundedCornerShape(20.dp))
|
||||
.clickable {
|
||||
AlertManager.shared.showAlertMsg(
|
||||
title = status.statusText,
|
||||
text = status.statusDescription
|
||||
)
|
||||
},
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
var modifier = Modifier.size(36.dp).clip(RoundedCornerShape(20.dp))
|
||||
val info = status.statusInto
|
||||
if (info != null) {
|
||||
modifier = modifier.clickable {
|
||||
AlertManager.shared.showAlertMsg(
|
||||
title = info.first,
|
||||
text = info.second
|
||||
)
|
||||
}
|
||||
}
|
||||
Box(modifier, contentAlignment = Alignment.Center) {
|
||||
if (statusIcon != null) {
|
||||
val (icon, statusColor) = statusIcon
|
||||
Icon(
|
||||
@@ -434,22 +433,6 @@ fun itemInfoShareText(chatModel: ChatModel, ci: ChatItem, chatItemInfo: ChatItem
|
||||
val t = qi.text
|
||||
shareText.add(if (t != "") t else generalGetString(MR.strings.item_info_no_text))
|
||||
}
|
||||
val mdss = chatItemInfo.memberDeliveryStatuses
|
||||
if (mdss != null) {
|
||||
val mss = membersStatuses(chatModel, mdss)
|
||||
if (mss.isNotEmpty()) {
|
||||
shareText.add("")
|
||||
shareText.add("## " + generalGetString(MR.strings.delivery))
|
||||
shareText.add("")
|
||||
mss.forEach { (member, status) ->
|
||||
shareText.add(String.format(
|
||||
generalGetString(MR.strings.recipient_colon_delivery_status),
|
||||
member.chatViewName,
|
||||
status.statusDescription
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
val versions = chatItemInfo.itemVersions
|
||||
if (versions.isNotEmpty()) {
|
||||
shareText.add("")
|
||||
|
||||
@@ -1553,22 +1553,6 @@
|
||||
<string name="you_can_enable_delivery_receipts_later_alert">You can enable them later via app Privacy & Security settings.</string>
|
||||
<string name="error_enabling_delivery_receipts">Error enabling delivery receipts!</string>
|
||||
|
||||
<!-- CIStatus texts -->
|
||||
<string name="item_status_snd_new_text">Sending message</string>
|
||||
<string name="item_status_snd_sent_text">Message sent</string>
|
||||
<string name="item_status_snd_rcvd_text">Sent message received</string>
|
||||
<string name="item_status_snd_error_text">Error sending message</string>
|
||||
<string name="item_status_rcv_new_text">Message received</string>
|
||||
<string name="item_status_rcv_read_text">Message read</string>
|
||||
|
||||
<string name="item_status_snd_new_desc">Sending message is in progress or pending.</string>
|
||||
<string name="item_status_snd_sent_desc">Message has been sent to the recipient\'s relay.</string>
|
||||
<string name="item_status_snd_rcvd_desc">Message has been received by the recipient.</string>
|
||||
<string name="item_status_snd_error_auth_desc">Message delivery error. Most likely this recipient has deleted the connection with you.</string>
|
||||
<string name="item_status_snd_error_unexpected_desc">Unexpected message delivery error: %1$s</string>
|
||||
<string name="item_status_rcv_new_desc">New message from this sender.</string>
|
||||
<string name="item_status_rcv_read_desc">You\'ve read this received message.</string>
|
||||
|
||||
<!-- Under development -->
|
||||
<string name="in_developing_title">Coming soon!</string>
|
||||
<string name="in_developing_desc">This feature is not yet supported. Try the next release.</string>
|
||||
|
||||
Reference in New Issue
Block a user