feat: Integrate AccountManager to retrieve last logged account in AuthFlow and update MainActivity
This commit is contained in:
@@ -269,11 +269,7 @@ fun AppleEmojiTextField(
|
||||
editTextView = this
|
||||
// Подключаем callback для изменения фокуса
|
||||
setOnFocusChangeListener { _, hasFocus ->
|
||||
android.util.Log.d("AppleEmojiTextField", "═══════════════════════════════════════════════════════")
|
||||
android.util.Log.d("AppleEmojiTextField", "🎯 Native EditText focus changed: hasFocus=$hasFocus")
|
||||
android.util.Log.d("AppleEmojiTextField", " 📍 Calling onFocusChanged callback...")
|
||||
onFocusChanged?.invoke(hasFocus)
|
||||
android.util.Log.d("AppleEmojiTextField", " ✅ onFocusChanged callback completed")
|
||||
}
|
||||
// Уведомляем о создании view
|
||||
onViewCreated?.invoke(this)
|
||||
|
||||
@@ -36,11 +36,6 @@ object KeyboardHeightProvider {
|
||||
val savedPx = prefs.getInt(KEY_KEYBOARD_HEIGHT, defaultPx)
|
||||
val isDefault = savedPx == defaultPx
|
||||
|
||||
android.util.Log.d(TAG, "═══════════════════════════════════════")
|
||||
android.util.Log.d(TAG, "📖 getSavedKeyboardHeight()")
|
||||
android.util.Log.d(TAG, " 📏 Height: ${savedPx}px (${pxToDp(context, savedPx)}dp)")
|
||||
android.util.Log.d(TAG, " 📦 Source: ${if (isDefault) "DEFAULT" else "SAVED"}")
|
||||
android.util.Log.d(TAG, "═══════════════════════════════════════")
|
||||
return savedPx
|
||||
}
|
||||
|
||||
@@ -48,8 +43,6 @@ object KeyboardHeightProvider {
|
||||
* Сохранить высоту клавиатуры
|
||||
*/
|
||||
fun saveKeyboardHeight(context: Context, heightPx: Int) {
|
||||
android.util.Log.d(TAG, "═══════════════════════════════════════")
|
||||
android.util.Log.d(TAG, "💾 saveKeyboardHeight($heightPx px)")
|
||||
|
||||
if (heightPx > 0) {
|
||||
val prefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
||||
@@ -58,19 +51,12 @@ object KeyboardHeightProvider {
|
||||
|
||||
prefs.edit().putInt(KEY_KEYBOARD_HEIGHT, heightPx).apply()
|
||||
|
||||
android.util.Log.d(TAG, " 📏 New: ${heightPx}px (${pxToDp(context, heightPx)}dp)")
|
||||
android.util.Log.d(TAG, " 📏 Old: ${oldHeight}px (${pxToDp(context, oldHeight)}dp)")
|
||||
android.util.Log.d(TAG, " 🔄 Changed: $changed")
|
||||
|
||||
if (changed) {
|
||||
android.util.Log.d(TAG, " ✅ SAVED successfully!")
|
||||
} else {
|
||||
android.util.Log.d(TAG, " ⏭️ Same height, no change")
|
||||
}
|
||||
} else {
|
||||
android.util.Log.w(TAG, " ⚠️ INVALID height: ${heightPx}px - NOT saved!")
|
||||
}
|
||||
android.util.Log.d(TAG, "═══════════════════════════════════════")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +64,6 @@ object KeyboardHeightProvider {
|
||||
* Telegram использует: AdjustPanLayoutHelper.keyboardDuration (250ms обычно)
|
||||
*/
|
||||
fun getKeyboardAnimationDuration(): Long {
|
||||
android.util.Log.d(TAG, "⏱️ getKeyboardAnimationDuration() = 250ms")
|
||||
return 250L
|
||||
}
|
||||
|
||||
@@ -107,9 +92,6 @@ fun rememberSavedKeyboardHeight(): Dp {
|
||||
val density = context.resources.displayMetrics.density
|
||||
val heightDp = (heightPx / density).dp
|
||||
|
||||
android.util.Log.d("KeyboardHeight", "🎯 rememberSavedKeyboardHeight()")
|
||||
android.util.Log.d("KeyboardHeight", " 📏 Result: $heightDp (${heightPx}px)")
|
||||
android.util.Log.d("KeyboardHeight", " 📱 Density: $density")
|
||||
|
||||
return heightDp
|
||||
}
|
||||
|
||||
@@ -61,11 +61,9 @@ object OptimizedEmojiCache {
|
||||
loadProgress = 1f
|
||||
}
|
||||
|
||||
android.util.Log.d("EmojiCache", "✅ Предзагрузка завершена за $duration ms")
|
||||
isLoaded = true
|
||||
isPreloading = false
|
||||
} catch (e: Exception) {
|
||||
android.util.Log.e("EmojiCache", "❌ Ошибка предзагрузки", e)
|
||||
allEmojis = emptyList()
|
||||
emojisByCategory = emptyMap()
|
||||
isLoaded = true
|
||||
@@ -85,7 +83,6 @@ object OptimizedEmojiCache {
|
||||
?: emptyList()
|
||||
|
||||
allEmojis = emojis
|
||||
android.util.Log.d("EmojiCache", "📦 Загружено ${emojis.size} эмодзи")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +122,6 @@ object OptimizedEmojiCache {
|
||||
}
|
||||
}
|
||||
|
||||
android.util.Log.d("EmojiCache", "🗂️ Эмодзи сгруппированы по ${result.size} категориям")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +136,6 @@ object OptimizedEmojiCache {
|
||||
?.take(PRELOAD_COUNT)
|
||||
?: emptyList()
|
||||
|
||||
android.util.Log.d("EmojiCache", "🎨 Предзагружаем ${smileysToPreload.size} популярных эмодзи...")
|
||||
|
||||
// Предзагружаем параллельно, но с ограничением
|
||||
val jobs = smileysToPreload.chunked(20).map { chunk ->
|
||||
@@ -164,7 +159,6 @@ object OptimizedEmojiCache {
|
||||
}
|
||||
|
||||
jobs.awaitAll()
|
||||
android.util.Log.d("EmojiCache", "✅ Предзагружено $preloadedCount изображений")
|
||||
isPreloading = false
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ fun OptimizedEmojiPicker(
|
||||
|
||||
// 🔥 Логирование изменений видимости
|
||||
LaunchedEffect(isVisible) {
|
||||
android.util.Log.d("EmojiPicker", "🎭 OptimizedEmojiPicker visibility: $isVisible (height=${savedKeyboardHeight})")
|
||||
}
|
||||
|
||||
// 🔥 Рендерим контент напрямую без AnimatedVisibility
|
||||
@@ -102,19 +101,15 @@ private fun EmojiPickerContent(
|
||||
var shouldRenderContent by remember { mutableStateOf(false) }
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
android.util.Log.d("EmojiPicker", "🚀 EmojiPickerContent started, keyboardHeight=$keyboardHeight")
|
||||
|
||||
// Ждём 1 кадр чтобы анимация началась плавно
|
||||
kotlinx.coroutines.delay(16) // ~1 frame at 60fps
|
||||
shouldRenderContent = true
|
||||
android.util.Log.d("EmojiPicker", "✅ Content rendering enabled after 16ms delay")
|
||||
|
||||
// Загружаем эмодзи если еще не загружены
|
||||
if (!OptimizedEmojiCache.isLoaded) {
|
||||
android.util.Log.d("EmojiPicker", "📦 Starting emoji preload...")
|
||||
OptimizedEmojiCache.preload(context)
|
||||
} else {
|
||||
android.util.Log.d("EmojiPicker", "✅ Emojis already loaded")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,11 +126,9 @@ private fun EmojiPickerContent(
|
||||
|
||||
// 🚀 При смене категории плавно скроллим наверх
|
||||
LaunchedEffect(selectedCategory) {
|
||||
android.util.Log.d("EmojiPicker", "📂 Category changed: ${selectedCategory.key} (${displayedEmojis.size} emojis)")
|
||||
if (displayedEmojis.isNotEmpty()) {
|
||||
scope.launch {
|
||||
gridState.animateScrollToItem(0)
|
||||
android.util.Log.v("EmojiPicker", "⬆️ Scrolled to top")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user