Browse Source

android: round send button with \u27A4 icon (matching desktop chatgui)

topo_upd
evgeny 2 months ago
parent
commit
b90728be3c
  1. 18
      tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt

18
tools/chatgui-android/app/src/main/java/com/utun/chat/ui/components/MessageBubble.kt

@ -5,8 +5,9 @@ import android.content.pm.PackageManager
import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.* import androidx.compose.material3.*
import androidx.compose.runtime.* import androidx.compose.runtime.*
@ -223,8 +224,19 @@ fun InputBar(
if (!isRecording) { if (!isRecording) {
Spacer(Modifier.width(4.dp)) Spacer(Modifier.width(4.dp))
Button(onClick = onSend, enabled = enabled && text.isNotBlank()) { val sendColor = MaterialTheme.colorScheme.primary
Text("Send") val sendEnabled = enabled && text.isNotBlank()
Box(
modifier = Modifier
.size(44.dp)
.background(
if (sendEnabled) sendColor else sendColor.copy(alpha = 0.35f),
CircleShape
)
.clickable { if (sendEnabled) onSend() },
contentAlignment = Alignment.Center
) {
Text("\u27A4", fontSize = 22.sp, color = Color.White)
} }
} }
} }

Loading…
Cancel
Save