mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-03 17:39:56 +00:00
android: create contacts with group members (#3078)
This commit is contained in:
+12
@@ -44,6 +44,7 @@ import java.net.URI
|
||||
@Composable
|
||||
actual fun PlatformTextField(
|
||||
composeState: MutableState<ComposeState>,
|
||||
sendMsgEnabled: Boolean,
|
||||
textStyle: MutableState<TextStyle>,
|
||||
showDeleteTextButton: MutableState<Boolean>,
|
||||
userIsObserver: Boolean,
|
||||
@@ -60,6 +61,7 @@ actual fun PlatformTextField(
|
||||
val paddingEnd = with(LocalDensity.current) { 45.dp.roundToPx() }
|
||||
val paddingBottom = with(LocalDensity.current) { 7.dp.roundToPx() }
|
||||
var showKeyboard by remember { mutableStateOf(false) }
|
||||
var freeFocus by remember { mutableStateOf(false) }
|
||||
LaunchedEffect(cs.contextItem) {
|
||||
if (cs.contextItem is ComposeContextItem.QuotedItem) {
|
||||
delay(100)
|
||||
@@ -70,6 +72,11 @@ actual fun PlatformTextField(
|
||||
showKeyboard = true
|
||||
}
|
||||
}
|
||||
LaunchedEffect(sendMsgEnabled) {
|
||||
if (!sendMsgEnabled) {
|
||||
freeFocus = true
|
||||
}
|
||||
}
|
||||
|
||||
AndroidView(modifier = Modifier, factory = {
|
||||
val editText = @SuppressLint("AppCompatCustomView") object: EditText(it) {
|
||||
@@ -142,6 +149,11 @@ actual fun PlatformTextField(
|
||||
imm.showSoftInput(it, InputMethodManager.SHOW_IMPLICIT)
|
||||
showKeyboard = false
|
||||
}
|
||||
if (freeFocus) {
|
||||
it.clearFocus()
|
||||
hideKeyboard(it)
|
||||
freeFocus = false
|
||||
}
|
||||
showDeleteTextButton.value = it.lineCount >= 4 && !cs.inProgress
|
||||
}
|
||||
if (composeState.value.preview is ComposePreview.VoicePreview) {
|
||||
|
||||
Reference in New Issue
Block a user