fix: streamline emoji picker and keyboard dismissal logic in ImageEditorScreen
This commit is contained in:
@@ -389,24 +389,16 @@ fun ImageEditorScreen(
|
|||||||
// Close button (X) - сначала закрывает emoji/клавиатуру, потом экран
|
// Close button (X) - сначала закрывает emoji/клавиатуру, потом экран
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = {
|
onClick = {
|
||||||
// Проверяем, открыт ли emoji picker
|
// Закрываем emoji picker если открыт
|
||||||
if (showEmojiPicker) {
|
showEmojiPicker = false
|
||||||
showEmojiPicker = false
|
|
||||||
return@IconButton
|
// Закрываем клавиатуру если открыта
|
||||||
}
|
|
||||||
|
|
||||||
// Проверяем, открыта ли клавиатура
|
|
||||||
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
val isKeyboardOpen = imm.isAcceptingText
|
imm.hideSoftInputFromWindow(view.windowToken, 0)
|
||||||
|
focusManager.clearFocus()
|
||||||
if (isKeyboardOpen) {
|
|
||||||
// Закрываем клавиатуру
|
// Всегда закрываем экран
|
||||||
imm.hideSoftInputFromWindow(view.windowToken, 0)
|
animatedDismiss()
|
||||||
focusManager.clearFocus()
|
|
||||||
} else {
|
|
||||||
// Закрываем экран с анимацией
|
|
||||||
animatedDismiss()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
modifier = Modifier.align(Alignment.CenterStart)
|
modifier = Modifier.align(Alignment.CenterStart)
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user