feat: add avatar presence handling in OtherProfileScreen for improved scroll behavior

This commit is contained in:
2026-02-14 03:13:19 +05:00
parent 2df37611e2
commit 9b0bde95d2
7 changed files with 70 additions and 12 deletions

View File

@@ -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"

View File

@@ -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
}
}
}

View File

@@ -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) }
)
}
}