diff --git a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt index ee34a35f0..b1275721f 100644 --- a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt @@ -8,6 +8,7 @@ import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.data.entities.Book import io.legado.app.help.ImageLoader +import io.legado.app.ui.changesource.ChangeSourceDialog import io.legado.app.utils.getViewModel import io.legado.app.utils.gone import io.legado.app.utils.visible @@ -20,6 +21,8 @@ class BookInfoActivity : VMBaseActivity(R.layout.activity_boo override val viewModel: BookInfoViewModel get() = getViewModel(BookInfoViewModel::class.java) + var changeSourceDialog: ChangeSourceDialog? = null + override fun onActivityCreated(savedInstanceState: Bundle?) { setSupportActionBar(toolbar) viewModel.bookData.observe(this, Observer { showBook(it) }) @@ -114,5 +117,11 @@ class BookInfoActivity : VMBaseActivity(R.layout.activity_boo } } tv_loading.onClick { } + tv_change_source.onClick { + if (changeSourceDialog == null) { + changeSourceDialog = ChangeSourceDialog() + } + changeSourceDialog?.show(supportFragmentManager, "changeSource") + } } } \ No newline at end of file