General improvements (#134)

* Add visual options and seamless transitions to the EPUB reader

* Add support for DOCX file format

* Refine padding and status bar inset handling in Epub pagination mode

* Add file size parameter for recent files and sorting

* Refactor book data cleanup logic into a centralized method

* Bump version to 1.0.40(41)
This commit is contained in:
Aryan 2026-03-30 22:44:26 +05:30 committed by GitHub
parent 15264a31ae
commit 6fd6dd5609
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 623 additions and 134 deletions

View file

@ -27,7 +27,7 @@ import androidx.room.TypeConverters
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
@Database(entities =[RecentFileEntity::class, CustomFontEntity::class], version = 15, exportSchema = false)
@Database(entities =[RecentFileEntity::class, CustomFontEntity::class], version = 16, exportSchema = false)
@TypeConverters(FileTypeConverter::class)
abstract class AppDatabase : RoomDatabase() {
abstract fun recentFileDao(): RecentFileDao
@ -185,6 +185,12 @@ abstract class AppDatabase : RoomDatabase() {
}
}
val MIGRATION_15_16 = object : Migration(15, 16) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE recent_files ADD COLUMN fileSize INTEGER NOT NULL DEFAULT 0")
}
}
fun getDatabase(context: Context): AppDatabase {
return INSTANCE ?: synchronized(this) {
val instance = Room.databaseBuilder(
@ -196,7 +202,7 @@ abstract class AppDatabase : RoomDatabase() {
MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5,
MIGRATION_5_6, MIGRATION_6_7, MIGRATION_7_8, MIGRATION_8_9,
MIGRATION_9_10, MIGRATION_10_11, MIGRATION_11_12,
MIGRATION_12_13, MIGRATION_13_14, MIGRATION_14_15
MIGRATION_12_13, MIGRATION_13_14, MIGRATION_14_15, MIGRATION_15_16
)
.fallbackToDestructiveMigration(false)
.build()