pull/32/head
kunfei 5 years ago
parent 845e8a3b18
commit 055b6d9e55
  1. 4
      app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt

@ -30,7 +30,7 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
viewModel.loadBook(intent) viewModel.loadBook(intent)
initView() initView()
savedInstanceState?.let { savedInstanceState?.let {
changeSourceDialog = supportFragmentManager.findFragmentByTag("changeSourceDialog") as? ChangeSourceDialog changeSourceDialog = supportFragmentManager.findFragmentByTag(ChangeSourceDialog.tag) as? ChangeSourceDialog
changeSourceDialog?.callBack = this changeSourceDialog?.callBack = this
} }
} }
@ -128,7 +128,7 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
changeSourceDialog?.callBack = this changeSourceDialog?.callBack = this
} }
} }
changeSourceDialog?.show(supportFragmentManager, "changeSource") changeSourceDialog?.show(supportFragmentManager, ChangeSourceDialog.tag)
} }
} }
} }

@ -16,6 +16,8 @@ import kotlinx.android.synthetic.main.dialog_change_source.*
class ChangeSourceDialog : DialogFragment() { class ChangeSourceDialog : DialogFragment() {
companion object { companion object {
const val tag = "changeSourceDialog"
fun newInstance(name: String, author: String): ChangeSourceDialog { fun newInstance(name: String, author: String): ChangeSourceDialog {
val changeSourceDialog = ChangeSourceDialog() val changeSourceDialog = ChangeSourceDialog()
val bundle = Bundle() val bundle = Bundle()

Loading…
Cancel
Save