feat: Add custom Telegram send icon and implement floating input for message entry in ChatDetailScreen
This commit is contained in:
@@ -109,7 +109,11 @@ class AppleEmojiEditTextView @JvmOverloads constructor(
|
||||
fun setTextWithEmojis(newText: String) {
|
||||
if (newText == text.toString()) return
|
||||
isUpdating = true
|
||||
val cursorPos = selectionStart
|
||||
setText(newText)
|
||||
// Восстанавливаем позицию курсора в конец текста
|
||||
val newCursorPos = if (cursorPos >= 0) newText.length else cursorPos
|
||||
setSelection(newCursorPos.coerceIn(0, newText.length))
|
||||
isUpdating = false
|
||||
replaceEmojisWithImages(editableText)
|
||||
}
|
||||
@@ -158,8 +162,9 @@ class AppleEmojiEditTextView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
// Восстанавливаем курсор, убедившись что он в допустимых пределах
|
||||
if (cursorPosition >= 0 && cursorPosition <= editable.length) {
|
||||
setSelection(cursorPosition)
|
||||
post { setSelection(cursorPosition.coerceIn(0, editable.length)) }
|
||||
}
|
||||
} finally {
|
||||
isUpdating = false
|
||||
|
||||
Reference in New Issue
Block a user