优化
This commit is contained in:
@@ -61,6 +61,7 @@ import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import splitties.init.appCtx
|
||||
import kotlin.math.max
|
||||
|
||||
/**
|
||||
@@ -440,22 +441,21 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
|
||||
alertDialog.hide()
|
||||
return@apply
|
||||
}
|
||||
val text = etInputScope.text
|
||||
if (!verificationField(text.toString())) {
|
||||
etInputScope.error =
|
||||
applicationContext.getString(R.string.error_scope_input)//"请输入正确的范围"
|
||||
val epubScope = etInputScope.text.toString()
|
||||
if (!verificationField(epubScope)) {
|
||||
etInputScope.error = appCtx.getString(R.string.error_scope_input)//"请输入正确的范围"
|
||||
return@apply
|
||||
}
|
||||
etInputScope.error = null
|
||||
val toInt = etEpubSize.text.toString().toInt()
|
||||
val epubSize = etEpubSize.text.toString().toIntOrNull() ?: 1
|
||||
adapter.getItem(position)?.let { book ->
|
||||
startService<ExportBookService> {
|
||||
action = IntentAction.start
|
||||
putExtra("bookUrl", book.bookUrl)
|
||||
putExtra("exportType", "epub")
|
||||
putExtra("exportPath", path)
|
||||
putExtra("epubSize", toInt)
|
||||
putExtra("epubScope", text.toString())
|
||||
putExtra("epubSize", epubSize)
|
||||
putExtra("epubScope", epubScope)
|
||||
}
|
||||
}
|
||||
alertDialog.hide()
|
||||
|
||||
Reference in New Issue
Block a user