diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 717541aaf..a02055ad2 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -19,6 +19,7 @@ import androidx.lifecycle.LifecycleRegistry import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import androidx.recyclerview.widget.ItemTouchHelper +import androidx.recyclerview.widget.RecyclerView import com.google.android.material.snackbar.Snackbar import io.legado.app.R import io.legado.app.base.VMBaseActivity @@ -49,6 +50,7 @@ import io.legado.app.ui.widget.recycler.DragSelectTouchHelper import io.legado.app.ui.widget.recycler.ItemTouchCallback import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.ACache +import io.legado.app.utils.NetworkUtils import io.legado.app.utils.applyTint import io.legado.app.utils.cnCompare import io.legado.app.utils.dpToPx @@ -103,6 +105,11 @@ class BookSourceActivity : VMBaseActivity() private val qrResult = registerForActivityResult(QrCodeResult()) { it ?: return@registerForActivityResult showDialogFragment(ImportBookSourceDialog(it)) @@ -265,6 +272,11 @@ class BookSourceActivity : VMBaseActivity { + item.isChecked = !item.isChecked + toggleDuplicationSourceView(item.isChecked) + } + R.id.menu_help -> showHelp("SourceMBookHelp") } if (item.groupId == R.id.source_group) { @@ -335,7 +347,12 @@ class BookSourceActivity : VMBaseActivity - if (sortAscending) { + hostMap.clear() + if (showDuplicationSource) { + data.sortedWith( + compareBy { getSourceHost(it.bookSourceUrl) == "#" } + .thenBy { getSourceHost(it.bookSourceUrl) }) + } else if (sortAscending) { when (sort) { BookSourceSort.Weight -> data.sortedBy { it.weight } BookSourceSort.Name -> data.sortedWith { o1, o2 -> @@ -383,7 +400,8 @@ class BookSourceActivity : VMBaseActivity adapter.setItems(data, adapter.diffItemCallback, !Debug.isChecking) - itemTouchCallback.isCanDrag = sort == BookSourceSort.Default + itemTouchCallback.isCanDrag = + sort == BookSourceSort.Default && !showDuplicationSource delay(500) } } @@ -667,6 +685,21 @@ class BookSourceActivity : VMBaseActivity + + 阅读需要读取手机状态实现来电期间暂停朗读功能 耳机按键启动朗读 通过耳机按键来启动朗读 + 显示重复书源 diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index e4efe5954..283220ed9 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -1177,4 +1177,5 @@ 阅读需要读取手机状态实现来电期间暂停朗读功能 耳机按键启动朗读 通过耳机按键来启动朗读 + 显示重复书源 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 1fe2ca8ea..43d6238b6 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1177,4 +1177,5 @@ 阅读需要读取手机状态实现来电期间暂停朗读功能 耳机按键启动朗读 通过耳机按键来启动朗读 + 显示重复书源 diff --git a/app/src/main/res/values-v24/strings.xml b/app/src/main/res/values-v24/strings.xml new file mode 100644 index 000000000..f97e6415f --- /dev/null +++ b/app/src/main/res/values-v24/strings.xml @@ -0,0 +1,4 @@ + + + 显示重复书源 + \ No newline at end of file diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 59658c4db..9575a8ecd 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -1173,4 +1173,5 @@ Còn 阅读需要读取手机状态实现来电期间暂停朗读功能 耳机按键启动朗读 通过耳机按键来启动朗读 + 显示重复书源 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index d2324913c..23669bafe 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -1174,4 +1174,5 @@ 阅读需要读取手机状态实现来电期间暂停朗读功能 耳机按键启动朗读 通过耳机按键来启动朗读 + 显示重复书源 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 6fe955f23..b9a6fcb93 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1176,4 +1176,5 @@ 阅读需要读取手机状态实现来电期间暂停朗读功能 耳机按键启动朗读 通过耳机按键来启动朗读 + 显示重复书源 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index e290459c9..067f77072 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1176,4 +1176,5 @@ 阅读需要读取手机状态实现来电期间暂停朗读功能 耳机按键启动朗读 通过耳机按键来启动朗读 + 显示重复书源 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3006f8a02..52089f9c2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1177,4 +1177,5 @@ 阅读需要读取手机状态实现来电期间暂停朗读功能 耳机按键启动朗读 通过耳机按键来启动朗读 + 显示重复书源