diff --git a/app/src/main/java/io/legado/app/data/entities/BookGroup.kt b/app/src/main/java/io/legado/app/data/entities/BookGroup.kt index f97974cbbeb3..ac4b048b5722 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookGroup.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookGroup.kt @@ -9,12 +9,13 @@ import io.legado.app.R import io.legado.app.help.config.AppConfig import kotlinx.parcelize.Parcelize +@Suppress("ConstPropertyName") @Parcelize @Entity(tableName = "book_groups") data class BookGroup( @PrimaryKey val groupId: Long = 0b1, - var groupName: String, + var groupName: String = "", var cover: String? = null, var order: Int = 0, @ColumnInfo(defaultValue = "1") diff --git a/app/src/main/java/io/legado/app/model/ImageProvider.kt b/app/src/main/java/io/legado/app/model/ImageProvider.kt index eb23262a3985..4cc0d8c4bc2d 100644 --- a/app/src/main/java/io/legado/app/model/ImageProvider.kt +++ b/app/src/main/java/io/legado/app/model/ImageProvider.kt @@ -40,7 +40,7 @@ object ImageProvider { private const val M = 1024 * 1024 val cacheSize: Int get() { - if (AppConfig.bitmapCacheSize <= 0) { + if (AppConfig.bitmapCacheSize <= 0 || AppConfig.bitmapCacheSize >= 2048) { AppConfig.bitmapCacheSize = 50 } return AppConfig.bitmapCacheSize * M diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt index 6366e0dc9a01..a51f563d2fdb 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt @@ -305,6 +305,7 @@ class ChangeBookSourceDialog() : BaseDialogFragment(R.layout.dialog_book_change_ override fun changeTo(searchBook: SearchBook) { val oldBookType = callBack?.oldBook?.type?.and(BookType.updateError.inv()) + ?.and(BookType.notShelf.inv()) if (searchBook.type == oldBookType) { changeSource(searchBook) { dismissAllowingStateLoss() diff --git a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt index 9a99cc27d7a5..f3e00314e94e 100644 --- a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt @@ -124,7 +124,7 @@ class OtherConfigFragment : PreferenceFragment(), PreferKey.bitmapCacheSize -> { NumberPickerDialog(requireContext()) .setTitle(getString(R.string.bitmap_cache_size)) - .setMaxValue(9999) + .setMaxValue(2047) .setMinValue(1) .setValue(AppConfig.bitmapCacheSize) .show { diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index 4e3c9cce7d39..2f0d00e45203 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -23,7 +23,6 @@ import io.legado.app.ui.file.HandleFileContract import io.legado.app.ui.login.SourceLoginActivity import io.legado.app.ui.qrcode.QrCodeResult import io.legado.app.ui.rss.source.debug.RssSourceDebugActivity -import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.ui.widget.dialog.UrlOptionDialog import io.legado.app.ui.widget.dialog.VariableDialog import io.legado.app.ui.widget.keyboard.KeyboardToolPop diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt index 91859db1ab74..fd837b15f89d 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt @@ -77,7 +77,15 @@ class TextDialog() : BaseDialogFragment(R.layout.dialog_text_view) { } Mode.HTML.name -> binding.textView.setHtml(content) - else -> binding.textView.text = content + else -> { + if (content.length >= 32 * 1024) { + val truncatedContent = + content.substring(0, 32 * 1024) + "\n\n数据太大,无法全部显示…" + binding.textView.text = truncatedContent + } else { + binding.textView.text = content + } + } } time = it.getLong("time", 0L) }