pull/1319/head
gedoor 3 years ago
parent 141e233f14
commit ec528a5ecd
  1. 13
      app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverDialog.kt
  2. 13
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt

@ -26,13 +26,12 @@ class ChangeCoverDialog : BaseDialogFragment(),
const val tag = "changeCoverDialog" const val tag = "changeCoverDialog"
fun show(manager: FragmentManager, name: String, author: String) { fun show(manager: FragmentManager, name: String, author: String) {
val fragment = (manager.findFragmentByTag(tag) as? ChangeCoverDialog) val fragment = ChangeCoverDialog().apply {
?: ChangeCoverDialog().apply { val bundle = Bundle()
val bundle = Bundle() bundle.putString("name", name)
bundle.putString("name", name) bundle.putString("author", author)
bundle.putString("author", author) arguments = bundle
arguments = bundle }
}
fragment.show(manager, tag) fragment.show(manager, tag)
} }
} }

@ -37,13 +37,12 @@ class ChangeSourceDialog : BaseDialogFragment(),
const val tag = "changeSourceDialog" const val tag = "changeSourceDialog"
fun show(manager: FragmentManager, name: String, author: String) { fun show(manager: FragmentManager, name: String, author: String) {
val fragment = (manager.findFragmentByTag(tag) as? ChangeSourceDialog) val fragment = ChangeSourceDialog().apply {
?: ChangeSourceDialog().apply { val bundle = Bundle()
val bundle = Bundle() bundle.putString("name", name)
bundle.putString("name", name) bundle.putString("author", author)
bundle.putString("author", author) arguments = bundle
arguments = bundle }
}
fragment.show(manager, tag) fragment.show(manager, tag)
} }
} }

Loading…
Cancel
Save