feat: Simplify animations across multiple screens by replacing slide transitions with fade animations for improved user experience

This commit is contained in:
2026-01-18 17:26:04 +05:00
parent 89e5f3cfa2
commit 61995e9286
16 changed files with 506 additions and 399 deletions

View File

@@ -4,6 +4,8 @@ import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
@Database(
entities = [
@@ -12,7 +14,7 @@ import androidx.room.RoomDatabase
DialogEntity::class,
BlacklistEntity::class
],
version = 4,
version = 5,
exportSchema = false
)
abstract class RosettaDatabase : RoomDatabase() {
@@ -24,6 +26,15 @@ abstract class RosettaDatabase : RoomDatabase() {
companion object {
@Volatile
private var INSTANCE: RosettaDatabase? = null
private val MIGRATION_4_5 = object : Migration(4, 5) {
override fun migrate(database: SupportSQLiteDatabase) {
// Добавляем новые столбцы для индикаторов прочтения
database.execSQL("ALTER TABLE dialogs ADD COLUMN last_message_from_me INTEGER NOT NULL DEFAULT 0")
database.execSQL("ALTER TABLE dialogs ADD COLUMN last_message_delivered INTEGER NOT NULL DEFAULT 0")
database.execSQL("ALTER TABLE dialogs ADD COLUMN last_message_read INTEGER NOT NULL DEFAULT 0")
}
}
fun getDatabase(context: Context): RosettaDatabase {
return INSTANCE ?: synchronized(this) {
@@ -33,7 +44,8 @@ abstract class RosettaDatabase : RoomDatabase() {
"rosetta_secure.db"
)
.setJournalMode(JournalMode.WRITE_AHEAD_LOGGING) // WAL mode for performance
.fallbackToDestructiveMigration() // Для разработки
.addMigrations(MIGRATION_4_5)
.fallbackToDestructiveMigration() // Для разработки - только если миграция не найдена
.build()
INSTANCE = instance
instance