pull/48/head
kunfei 5 years ago
parent 6ad7cbed20
commit c7d858c1d7
  1. 3
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditViewModel.kt

@ -8,6 +8,7 @@ import io.legado.app.App
import io.legado.app.base.BaseViewModel import io.legado.app.base.BaseViewModel
import io.legado.app.data.entities.BookSource import io.legado.app.data.entities.BookSource
import io.legado.app.help.storage.OldRule import io.legado.app.help.storage.OldRule
import kotlinx.coroutines.Dispatchers
class BookSourceEditViewModel(application: Application) : BaseViewModel(application) { class BookSourceEditViewModel(application: Application) : BaseViewModel(application) {
@ -49,7 +50,7 @@ class BookSourceEditViewModel(application: Application) : BaseViewModel(applicat
} }
fun pasteSource(onSuccess: (source: BookSource) -> Unit) { fun pasteSource(onSuccess: (source: BookSource) -> Unit) {
execute { execute(context = Dispatchers.Main) {
var source: BookSource? = null var source: BookSource? = null
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager? val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager?
clipboard?.primaryClip?.let { clipboard?.primaryClip?.let {

Loading…
Cancel
Save