Update the strings for unsupported calls
This commit is contained in:
@@ -7,24 +7,21 @@
|
||||
|
||||
package io.element.android.features.messages.impl.timeline.components.event
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import io.element.android.compound.theme.ElementTheme
|
||||
import io.element.android.compound.tokens.generated.CompoundIcons
|
||||
import io.element.android.features.messages.impl.R
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreview
|
||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.ui.strings.CommonStrings
|
||||
|
||||
@Composable
|
||||
fun TimelineItemLegacyCallInviteView(
|
||||
@@ -32,20 +29,18 @@ fun TimelineItemLegacyCallInviteView(
|
||||
) {
|
||||
Row(
|
||||
modifier = modifier,
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Icon(
|
||||
imageVector = CompoundIcons.VoiceCall(),
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
tint = ElementTheme.colors.iconSecondary,
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text(
|
||||
color = MaterialTheme.colorScheme.secondary,
|
||||
color = ElementTheme.colors.textSecondary,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
text = stringResource(CommonStrings.common_call_invite),
|
||||
textAlign = TextAlign.Center,
|
||||
text = stringResource(R.string.screen_room_timeline_legacy_call),
|
||||
textAlign = TextAlign.Start,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class DefaultMessageSummaryFormatter @Inject constructor(
|
||||
is TimelineItemVideoContent -> context.getString(CommonStrings.common_video)
|
||||
is TimelineItemFileContent -> context.getString(CommonStrings.common_file)
|
||||
is TimelineItemAudioContent -> context.getString(CommonStrings.common_audio)
|
||||
is TimelineItemLegacyCallInviteContent -> context.getString(CommonStrings.common_call_invite)
|
||||
is TimelineItemLegacyCallInviteContent -> context.getString(CommonStrings.common_unsupported_call)
|
||||
is TimelineItemCallNotifyContent -> context.getString(CommonStrings.common_call_started)
|
||||
}.take(MAX_SAFE_LENGTH)
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<string name="screen_room_timeline_add_reaction">"Add emoji"</string>
|
||||
<string name="screen_room_timeline_beginning_of_room">"This is the beginning of %1$s."</string>
|
||||
<string name="screen_room_timeline_beginning_of_room_no_name">"This is the beginning of this conversation."</string>
|
||||
<string name="screen_room_timeline_legacy_call">"Unsupported call. Ask if the caller can use the new Element X app."</string>
|
||||
<string name="screen_room_timeline_less_reactions">"Show less"</string>
|
||||
<string name="screen_room_timeline_message_copied">"Message copied"</string>
|
||||
<string name="screen_room_timeline_no_permission_to_post">"You do not have permission to post to this room"</string>
|
||||
|
||||
@@ -91,7 +91,7 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
||||
val message = sp.getString(CommonStrings.common_unsupported_event)
|
||||
message.prefixIfNeeded(senderDisambiguatedDisplayName, isDmRoom, isOutgoing)
|
||||
}
|
||||
is LegacyCallInviteContent -> sp.getString(CommonStrings.common_call_invite)
|
||||
is LegacyCallInviteContent -> sp.getString(CommonStrings.common_unsupported_call)
|
||||
is CallNotifyContent -> sp.getString(CommonStrings.common_call_started)
|
||||
}?.take(MAX_SAFE_LENGTH)
|
||||
}
|
||||
|
||||
@@ -52,13 +52,11 @@ class DefaultTimelineEventFormatter @Inject constructor(
|
||||
is StateContent -> {
|
||||
stateContentFormatter.format(content, senderDisambiguatedDisplayName, isOutgoing, RenderingMode.Timeline)
|
||||
}
|
||||
is LegacyCallInviteContent -> {
|
||||
sp.getString(CommonStrings.common_call_invite)
|
||||
}
|
||||
is CallNotifyContent -> {
|
||||
sp.getString(CommonStrings.common_call_started)
|
||||
}
|
||||
RedactedContent,
|
||||
is LegacyCallInviteContent,
|
||||
is StickerContent,
|
||||
is PollContent,
|
||||
is UnableToDecryptContent,
|
||||
|
||||
@@ -151,7 +151,7 @@ class DefaultNotifiableEventResolver @Inject constructor(
|
||||
noisy = isNoisy,
|
||||
timestamp = this.timestamp,
|
||||
senderDisambiguatedDisplayName = getDisambiguatedDisplayName(content.senderId),
|
||||
body = stringProvider.getString(CommonStrings.common_call_invite),
|
||||
body = stringProvider.getString(CommonStrings.common_unsupported_call),
|
||||
roomName = roomDisplayName,
|
||||
roomIsDm = isDm,
|
||||
roomAvatarPath = roomAvatarUrl,
|
||||
|
||||
@@ -588,7 +588,7 @@ class DefaultNotifiableEventResolverTest {
|
||||
noisy = false,
|
||||
timestamp = A_TIMESTAMP,
|
||||
senderDisambiguatedDisplayName = A_USER_NAME_2,
|
||||
body = "Call in progress (unsupported)",
|
||||
body = "Unsupported call",
|
||||
imageUriString = null,
|
||||
imageMimeType = null,
|
||||
threadId = null,
|
||||
|
||||
@@ -247,6 +247,7 @@ Reason: %1$s."</string>
|
||||
<string name="common_unable_to_invite_title">"Unable to send invite(s)"</string>
|
||||
<string name="common_unlock">"Unlock"</string>
|
||||
<string name="common_unmute">"Unmute"</string>
|
||||
<string name="common_unsupported_call">"Unsupported call"</string>
|
||||
<string name="common_unsupported_event">"Unsupported event"</string>
|
||||
<string name="common_username">"Username"</string>
|
||||
<string name="common_verification_cancelled">"Verification cancelled"</string>
|
||||
|
||||
@@ -23,6 +23,8 @@ forbiddenTerms = {
|
||||
"screen_onboarding_welcome_title",
|
||||
# Contains "Element Call"
|
||||
"screen_incoming_call_subtitle_android",
|
||||
# Contains "Element X"
|
||||
"screen_room_timeline_legacy_call",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user