feat: enhance image viewer navigation with tap animations and controls visibility

This commit is contained in:
k1ngsterr1
2026-02-09 21:14:10 +05:00
parent efdb93d136
commit 3c37a3b0e5
12 changed files with 1620 additions and 376 deletions

View File

@@ -11,9 +11,12 @@ import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.rosetta.messenger.MainActivity
import com.rosetta.messenger.R
import com.rosetta.messenger.data.AccountManager
import com.rosetta.messenger.data.PreferencesManager
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.runBlocking
/**
* Firebase Cloud Messaging Service для обработки push-уведомлений
@@ -87,6 +90,10 @@ class RosettaFirebaseMessagingService : FirebaseMessagingService() {
if (isAppInForeground) {
return
}
val senderKey = senderPublicKey?.trim().orEmpty()
if (senderKey.isNotEmpty() && isDialogMuted(senderKey)) {
return
}
createNotificationChannel()
@@ -183,4 +190,16 @@ class RosettaFirebaseMessagingService : FirebaseMessagingService() {
val prefs = getSharedPreferences("rosetta_prefs", Context.MODE_PRIVATE)
prefs.edit().putString("fcm_token", token).apply()
}
/** Проверка: замьючен ли диалог для текущего аккаунта */
private fun isDialogMuted(senderPublicKey: String): Boolean {
if (senderPublicKey.isBlank()) return false
return runCatching {
val accountManager = AccountManager(applicationContext)
val currentAccount = accountManager.getLastLoggedPublicKey().orEmpty()
runBlocking {
PreferencesManager(applicationContext).isChatMuted(currentAccount, senderPublicKey)
}
}.getOrDefault(false)
}
}