From 3d1dd8a27e91c2f410b5aa045ed7257efe020583 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 5 Apr 2022 11:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/lib/dialogs/AndroidDialogs.kt | 4 ++-- .../changesource/ChangeBookSourceDialog.kt | 18 ++++++++++++++++-- app/src/main/res/values-es-rES/strings.xml | 2 ++ app/src/main/res/values-ja-rJP/strings.xml | 2 ++ app/src/main/res/values-pt-rBR/strings.xml | 2 ++ app/src/main/res/values-zh-rHK/strings.xml | 2 ++ app/src/main/res/values-zh-rTW/strings.xml | 2 ++ app/src/main/res/values-zh/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 9 files changed, 32 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/dialogs/AndroidDialogs.kt b/app/src/main/java/io/legado/app/lib/dialogs/AndroidDialogs.kt index 5d99e575e..7690a47c3 100644 --- a/app/src/main/java/io/legado/app/lib/dialogs/AndroidDialogs.kt +++ b/app/src/main/java/io/legado/app/lib/dialogs/AndroidDialogs.kt @@ -48,9 +48,9 @@ fun Context.alert( inline fun Fragment.alert( titleResource: Int? = null, - message: Int? = null, + messageResource: Int? = null, noinline init: (AlertBuilder.() -> Unit)? = null -) = requireActivity().alert(titleResource, message, init) +) = requireActivity().alert(titleResource, messageResource, init) fun Context.alert(init: AlertBuilder.() -> Unit): AlertDialog = AndroidAlertBuilder(this).apply { diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt index ba49a97f4..a4454a4a7 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeBookSourceDialog.kt @@ -244,8 +244,22 @@ class ChangeBookSourceDialog() : BaseDialogFragment(R.layout.dialog_book_change_ } override fun changeTo(searchBook: SearchBook) { - changeSource(searchBook) { - dismissAllowingStateLoss() + if (searchBook.type == callBack?.oldBook?.type) { + changeSource(searchBook) { + dismissAllowingStateLoss() + } + } else { + alert( + titleResource = R.string.book_type_different, + messageResource = R.string.soure_change_source + ) { + okButton { + changeSource(searchBook) { + dismissAllowingStateLoss() + } + } + cancelButton() + } } } diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index a1e268659..1d1f99dd4 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -967,5 +967,7 @@ 非播放状态无法定时 所有书签 批量换源 + 书籍类型不一样 + 是否确认换源 diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 6385d91c4..5750cbd33 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -970,5 +970,7 @@ 非播放状态无法定时 所有书签 批量换源 + 书籍类型不一样 + 是否确认换源 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index ed9f73916..4f7ab32b5 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -970,5 +970,7 @@ 非播放状态无法定时 所有书签 批量换源 + 书籍类型不一样 + 是否确认换源 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index c39a50545..db3577f15 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -967,5 +967,7 @@ 非播放状态无法定时 所有书签 批量换源 + 书籍类型不一样 + 是否确认换源 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 3c04da369..34522ec7c 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -969,5 +969,7 @@ 非播放状态无法定时 所有书签 批量换源 + 书籍类型不一样 + 是否确认换源 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 04a0addf0..0a523a078 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -969,5 +969,7 @@ 非播放状态无法定时 所有书签 批量换源 + 书籍类型不一样 + 是否确认换源 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4c670bbb2..f58de7779 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -970,5 +970,7 @@ 非播放状态无法定时 所有书签 批量换源 + 书籍类型不一样 + 是否确认换源