mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-07 21:53:29 +00:00
android: do not show message bubble tails on Android 8 (#6087)
This commit is contained in:
+5
-1
@@ -1280,7 +1280,11 @@ sealed class ShapeStyle {
|
||||
data class RoundRect(val radius: Dp) : ShapeStyle()
|
||||
}
|
||||
|
||||
fun shapeStyle(chatItem: ChatItem? = null, tailEnabled: Boolean, tailVisible: Boolean, revealed: Boolean): ShapeStyle {
|
||||
val shapeStyle: (chatItem: ChatItem?, tailEnabled: Boolean, tailVisible: Boolean, revealed: Boolean) -> ShapeStyle =
|
||||
if (appPlatform.isDesktop || (platform.androidApiLevel ?: 0) > 27) ::shapeStyleWithTail
|
||||
else { _, _, _, _ -> ShapeStyle.RoundRect(msgRectMaxRadius) }
|
||||
|
||||
fun shapeStyleWithTail(chatItem: ChatItem? = null, tailEnabled: Boolean, tailVisible: Boolean, revealed: Boolean): ShapeStyle {
|
||||
if (chatItem == null) {
|
||||
return ShapeStyle.RoundRect(msgRectMaxRadius)
|
||||
}
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ fun FramedItemView(
|
||||
var metaColor = MaterialTheme.colors.secondary
|
||||
Box(contentAlignment = Alignment.BottomEnd) {
|
||||
val chatItemTail = remember { appPreferences.chatItemTail.state }
|
||||
val style = shapeStyle(ci, chatItemTail.value, tailVisible, revealed = true)
|
||||
val style = shapeStyle(ci, chatItemTail.value, tailVisible, true)
|
||||
val tailRendered = style is ShapeStyle.Bubble && style.tailVisible
|
||||
Column(
|
||||
Modifier
|
||||
|
||||
+3
-1
@@ -195,7 +195,9 @@ object AppearanceScope {
|
||||
)
|
||||
)
|
||||
}
|
||||
SettingsPreferenceItem(icon = null, stringResource(MR.strings.settings_message_shape_tail), appPreferences.chatItemTail)
|
||||
if (appPlatform.isDesktop || (platform.androidApiLevel ?: 0) > 27) {
|
||||
SettingsPreferenceItem(icon = null, stringResource(MR.strings.settings_message_shape_tail), appPreferences.chatItemTail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user