feat: add avatar presence handling in OtherProfileScreen for improved scroll behavior
This commit is contained in:
@@ -536,9 +536,11 @@ class ChatsListViewModel(application: Application) : AndroidViewModel(applicatio
|
||||
// 🔥 Обновляем счетчик requests
|
||||
_requestsCount.value = _requests.value.size
|
||||
|
||||
// Вычисляем правильный dialog_key (отсортированная комбинация ключей)
|
||||
// Вычисляем правильный dialog_key
|
||||
val dialogKey =
|
||||
if (currentAccount < opponentKey) {
|
||||
if (currentAccount == opponentKey) {
|
||||
currentAccount // 📁 Saved Messages
|
||||
} else if (currentAccount < opponentKey) {
|
||||
"$currentAccount:$opponentKey"
|
||||
} else {
|
||||
"$opponentKey:$currentAccount"
|
||||
|
||||
@@ -62,11 +62,15 @@ fun SearchScreen(
|
||||
val view = LocalView.current
|
||||
val focusManager = LocalFocusManager.current
|
||||
if (!view.isInEditMode) {
|
||||
SideEffect {
|
||||
DisposableEffect(isDarkTheme) {
|
||||
val window = (view.context as android.app.Activity).window
|
||||
val insetsController = androidx.core.view.WindowCompat.getInsetsController(window, view)
|
||||
insetsController.isAppearanceLightStatusBars = !isDarkTheme
|
||||
window.statusBarColor = android.graphics.Color.TRANSPARENT
|
||||
onDispose {
|
||||
// Restore white status bar icons for chat list header
|
||||
insetsController.isAppearanceLightStatusBars = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,12 +227,28 @@ fun MessageInputBar(
|
||||
},
|
||||
hideEmoji = { onToggleEmojiPicker(false) }
|
||||
)
|
||||
} else {
|
||||
// KEYBOARD → EMOJI
|
||||
} else if (coordinator.isKeyboardVisible || coordinator.keyboardHeight > 0.dp) {
|
||||
// KEYBOARD → EMOJI (клавиатура открыта)
|
||||
coordinator.requestShowEmoji(
|
||||
hideKeyboard = { imm.hideSoftInputFromWindow(view.windowToken, 0) },
|
||||
showEmoji = { onToggleEmojiPicker(true) }
|
||||
)
|
||||
} else {
|
||||
// Клавиатура НЕ открыта → открываем emoji напрямую
|
||||
// Устанавливаем высоту из сохранённой или дефолт
|
||||
if (coordinator.emojiHeight == 0.dp) {
|
||||
val savedPx = com.rosetta.messenger.ui.components.KeyboardHeightProvider
|
||||
.getSavedKeyboardHeight(context)
|
||||
if (savedPx > 0) {
|
||||
coordinator.emojiHeight = with(density) { savedPx.toDp() }
|
||||
} else {
|
||||
coordinator.emojiHeight = 300.dp // разумный дефолт
|
||||
}
|
||||
}
|
||||
coordinator.isEmojiBoxVisible = true
|
||||
coordinator.openEmojiOnly(
|
||||
showEmoji = { onToggleEmojiPicker(true) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user