@ -48,9 +48,9 @@ fun Context.alert(
inline fun Fragment.alert(
titleResource: Int? = null,
message: Int? = null,
messageResource: Int? = null,
noinline init: (AlertBuilder<DialogInterface>.() -> Unit)? = null
) = requireActivity().alert(titleResource, message, init)
) = requireActivity().alert(titleResource, messageResource, init)
fun Context.alert(init: AlertBuilder<AlertDialog>.() -> Unit): AlertDialog =
AndroidAlertBuilder(this).apply {
@ -244,9 +244,23 @@ class ChangeBookSourceDialog() : BaseDialogFragment(R.layout.dialog_book_change_
}
override fun changeTo(searchBook: SearchBook) {
if (searchBook.type == callBack?.oldBook?.type) {
changeSource(searchBook) {
dismissAllowingStateLoss()
} else {
alert(
titleResource = R.string.book_type_different,
messageResource = R.string.soure_change_source
) {
okButton {
cancelButton()
override val bookUrl: String?
@ -967,5 +967,7 @@
<string name="cannot_timed_non_playback">非播放状态无法定时</string>
<string name="all_bookmark">所有书签</string>
<string name="change_source_batch">批量换源</string>
<string name="book_type_different">书籍类型不一样</string>
<string name="soure_change_source">是否确认换源</string>
<!-- string end -->
</resources>
@ -970,5 +970,7 @@
@ -969,5 +969,7 @@