|
|
@ -3,6 +3,7 @@ package io.legado.app.ui.book.source.edit |
|
|
|
import android.app.Application |
|
|
|
import android.app.Application |
|
|
|
import android.content.ClipboardManager |
|
|
|
import android.content.ClipboardManager |
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
|
|
|
|
import android.content.Intent |
|
|
|
import androidx.lifecycle.MutableLiveData |
|
|
|
import androidx.lifecycle.MutableLiveData |
|
|
|
import io.legado.app.App |
|
|
|
import io.legado.app.App |
|
|
|
import io.legado.app.base.BaseViewModel |
|
|
|
import io.legado.app.base.BaseViewModel |
|
|
@ -14,8 +15,9 @@ class BookSourceEditViewModel(application: Application) : BaseViewModel(applicat |
|
|
|
val sourceLiveData: MutableLiveData<BookSource> = MutableLiveData() |
|
|
|
val sourceLiveData: MutableLiveData<BookSource> = MutableLiveData() |
|
|
|
var oldSourceUrl: String? = null |
|
|
|
var oldSourceUrl: String? = null |
|
|
|
|
|
|
|
|
|
|
|
fun setBookSource(key: String?) { |
|
|
|
fun initData(intent: Intent) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
|
|
|
|
val key = intent.getStringExtra("data") |
|
|
|
var source: BookSource? = null |
|
|
|
var source: BookSource? = null |
|
|
|
if (key != null) { |
|
|
|
if (key != null) { |
|
|
|
source = App.db.bookSourceDao().getBookSource(key) |
|
|
|
source = App.db.bookSourceDao().getBookSource(key) |
|
|
|