mirror of
https://github.com/gedoor/legado.git
synced 2024-07-17 00:58:29 +08:00
优化
This commit is contained in:
parent
15c0b2a3cc
commit
761a560d0c
@ -110,23 +110,19 @@ class DirectLinkUploadConfig : BaseDialogFragment(R.layout.dialog_direct_link_up
|
||||
execute {
|
||||
DirectLinkUpload.upLoad("test.json", "{}", "application/json", rule)
|
||||
}.onError {
|
||||
val result = it.localizedMessage ?: "ERROR"
|
||||
alert {
|
||||
setTitle("result")
|
||||
setMessage(result)
|
||||
okButton()
|
||||
negativeButton(R.string.copy_text) {
|
||||
appCtx.sendToClip(result)
|
||||
}
|
||||
}
|
||||
alertTestResult(it.localizedMessage ?: "ERROR")
|
||||
}.onSuccess { result ->
|
||||
alert {
|
||||
setTitle("result")
|
||||
setMessage(result)
|
||||
okButton()
|
||||
negativeButton(R.string.copy_text) {
|
||||
appCtx.sendToClip(result)
|
||||
}
|
||||
alertTestResult(result)
|
||||
}
|
||||
}
|
||||
|
||||
private fun alertTestResult(result: String) {
|
||||
alert {
|
||||
setTitle("result")
|
||||
setMessage(result)
|
||||
okButton()
|
||||
negativeButton(R.string.copy_text) {
|
||||
appCtx.sendToClip(result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user