优化
This commit is contained in:
@@ -16,6 +16,7 @@ import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel
|
|||||||
import io.legado.app.R
|
import io.legado.app.R
|
||||||
import io.legado.app.base.VMBaseActivity
|
import io.legado.app.base.VMBaseActivity
|
||||||
import io.legado.app.constant.AppConst
|
import io.legado.app.constant.AppConst
|
||||||
|
import io.legado.app.constant.BookType
|
||||||
import io.legado.app.data.entities.BookSource
|
import io.legado.app.data.entities.BookSource
|
||||||
import io.legado.app.data.entities.rule.*
|
import io.legado.app.data.entities.rule.*
|
||||||
import io.legado.app.databinding.ActivityBookSourceEditBinding
|
import io.legado.app.databinding.ActivityBookSourceEditBinding
|
||||||
@@ -194,8 +195,8 @@ class BookSourceEditActivity :
|
|||||||
binding.cbIsEnableFind.isChecked = it.enabledExplore
|
binding.cbIsEnableFind.isChecked = it.enabledExplore
|
||||||
binding.spType.setSelection(
|
binding.spType.setSelection(
|
||||||
when (it.bookSourceType) {
|
when (it.bookSourceType) {
|
||||||
3 -> 2
|
BookType.image -> 2
|
||||||
1 -> 1
|
BookType.audio -> 1
|
||||||
else -> 0
|
else -> 0
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -298,9 +299,9 @@ class BookSourceEditActivity :
|
|||||||
source.enabled = binding.cbIsEnable.isChecked
|
source.enabled = binding.cbIsEnable.isChecked
|
||||||
source.enabledExplore = binding.cbIsEnableFind.isChecked
|
source.enabledExplore = binding.cbIsEnableFind.isChecked
|
||||||
source.bookSourceType = when (binding.spType.selectedItemPosition) {
|
source.bookSourceType = when (binding.spType.selectedItemPosition) {
|
||||||
2 -> 3
|
2 -> BookType.image
|
||||||
1 -> 1
|
1 -> BookType.audio
|
||||||
else -> 0
|
else -> BookType.default
|
||||||
}
|
}
|
||||||
val searchRule = SearchRule()
|
val searchRule = SearchRule()
|
||||||
val exploreRule = ExploreRule()
|
val exploreRule = ExploreRule()
|
||||||
|
|||||||
Reference in New Issue
Block a user