feat: Implement optimized emoji picker and cache with preloading and smooth animations

This commit is contained in:
2026-01-15 01:45:48 +05:00
parent 65094125f6
commit 35e21fd3f6
5 changed files with 1114 additions and 30 deletions

View File

@@ -65,6 +65,7 @@ import com.rosetta.messenger.data.Message
import com.rosetta.messenger.network.DeliveryStatus
import com.rosetta.messenger.network.SearchUser
import com.rosetta.messenger.ui.components.AppleEmojiPickerPanel
import com.rosetta.messenger.ui.components.OptimizedEmojiPicker
import com.rosetta.messenger.ui.components.AppleEmojiText
import com.rosetta.messenger.ui.components.AppleEmojiTextField
import com.rosetta.messenger.ui.components.VerifiedBadge
@@ -2308,36 +2309,22 @@ private fun MessageInputBar(
} // End of else (not blocked)
// 🔥 APPLE EMOJI PICKER - плавная анимация slide up
// 🔥 ОПТИМИЗИРОВАННЫЙ EMOJI PICKER - с предзагрузкой и smooth animations
if (!isBlocked) {
// Показываем только когда клавиатура закрыта И эмодзи открыты
val showPanel = showEmojiPicker && !isKeyboardVisible
AnimatedVisibility(
visible = showPanel,
enter = slideInVertically(
initialOffsetY = { it }, // Снизу вверх
animationSpec = tween(150, easing = FastOutSlowInEasing) // 🚀 Быстрее и плавнее
),
exit = slideOutVertically(
targetOffsetY = { it }, // Сверху вниз
animationSpec = tween(150, easing = FastOutSlowInEasing)
)
) {
AppleEmojiPickerPanel(
isDarkTheme = isDarkTheme,
onEmojiSelected = { emoji ->
onValueChange(value + emoji)
},
onClose = {
// 🔥 Используем toggleEmojiPicker() - он закроет панель и откроет клавиатуру
toggleEmojiPicker()
},
modifier = Modifier
.fillMaxWidth()
.height(emojiPanelHeight)
)
}
// Новый оптимизированный пикер автоматически управляет анимациями
OptimizedEmojiPicker(
isVisible = showEmojiPicker && !isKeyboardVisible,
isDarkTheme = isDarkTheme,
onEmojiSelected = { emoji ->
onValueChange(value + emoji)
},
onClose = {
// 🔥 Используем toggleEmojiPicker() - он закроет панель и откроет клавиатуру
toggleEmojiPicker()
},
modifier = Modifier
.fillMaxWidth()
)
} // End of if (!isBlocked) for emoji picker
}
}