优化
This commit is contained in:
@@ -9,12 +9,13 @@ import io.legado.app.R
|
|||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
|
@Suppress("ConstPropertyName")
|
||||||
@Parcelize
|
@Parcelize
|
||||||
@Entity(tableName = "book_groups")
|
@Entity(tableName = "book_groups")
|
||||||
data class BookGroup(
|
data class BookGroup(
|
||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
val groupId: Long = 0b1,
|
val groupId: Long = 0b1,
|
||||||
var groupName: String,
|
var groupName: String = "",
|
||||||
var cover: String? = null,
|
var cover: String? = null,
|
||||||
var order: Int = 0,
|
var order: Int = 0,
|
||||||
@ColumnInfo(defaultValue = "1")
|
@ColumnInfo(defaultValue = "1")
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ object ImageProvider {
|
|||||||
private const val M = 1024 * 1024
|
private const val M = 1024 * 1024
|
||||||
val cacheSize: Int
|
val cacheSize: Int
|
||||||
get() {
|
get() {
|
||||||
if (AppConfig.bitmapCacheSize <= 0) {
|
if (AppConfig.bitmapCacheSize <= 0 || AppConfig.bitmapCacheSize >= 2048) {
|
||||||
AppConfig.bitmapCacheSize = 50
|
AppConfig.bitmapCacheSize = 50
|
||||||
}
|
}
|
||||||
return AppConfig.bitmapCacheSize * M
|
return AppConfig.bitmapCacheSize * M
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ class ChangeBookSourceDialog() : BaseDialogFragment(R.layout.dialog_book_change_
|
|||||||
|
|
||||||
override fun changeTo(searchBook: SearchBook) {
|
override fun changeTo(searchBook: SearchBook) {
|
||||||
val oldBookType = callBack?.oldBook?.type?.and(BookType.updateError.inv())
|
val oldBookType = callBack?.oldBook?.type?.and(BookType.updateError.inv())
|
||||||
|
?.and(BookType.notShelf.inv())
|
||||||
if (searchBook.type == oldBookType) {
|
if (searchBook.type == oldBookType) {
|
||||||
changeSource(searchBook) {
|
changeSource(searchBook) {
|
||||||
dismissAllowingStateLoss()
|
dismissAllowingStateLoss()
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class OtherConfigFragment : PreferenceFragment(),
|
|||||||
PreferKey.bitmapCacheSize -> {
|
PreferKey.bitmapCacheSize -> {
|
||||||
NumberPickerDialog(requireContext())
|
NumberPickerDialog(requireContext())
|
||||||
.setTitle(getString(R.string.bitmap_cache_size))
|
.setTitle(getString(R.string.bitmap_cache_size))
|
||||||
.setMaxValue(9999)
|
.setMaxValue(2047)
|
||||||
.setMinValue(1)
|
.setMinValue(1)
|
||||||
.setValue(AppConfig.bitmapCacheSize)
|
.setValue(AppConfig.bitmapCacheSize)
|
||||||
.show {
|
.show {
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import io.legado.app.ui.file.HandleFileContract
|
|||||||
import io.legado.app.ui.login.SourceLoginActivity
|
import io.legado.app.ui.login.SourceLoginActivity
|
||||||
import io.legado.app.ui.qrcode.QrCodeResult
|
import io.legado.app.ui.qrcode.QrCodeResult
|
||||||
import io.legado.app.ui.rss.source.debug.RssSourceDebugActivity
|
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.UrlOptionDialog
|
||||||
import io.legado.app.ui.widget.dialog.VariableDialog
|
import io.legado.app.ui.widget.dialog.VariableDialog
|
||||||
import io.legado.app.ui.widget.keyboard.KeyboardToolPop
|
import io.legado.app.ui.widget.keyboard.KeyboardToolPop
|
||||||
|
|||||||
@@ -77,7 +77,15 @@ class TextDialog() : BaseDialogFragment(R.layout.dialog_text_view) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Mode.HTML.name -> binding.textView.setHtml(content)
|
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)
|
time = it.getLong("time", 0L)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user