diff --git a/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt b/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt index a22c15bfe..6a8017eb5 100644 --- a/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt +++ b/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt @@ -174,8 +174,7 @@ abstract class CommonRecyclerAdapter(protected val conte val srcPosition = oldPosition + getHeaderCount() val targetPosition = newPosition + getHeaderCount() Collections.swap(this.items, srcPosition, targetPosition) - notifyItemChanged(srcPosition) - notifyItemChanged(targetPosition) + notifyItemMoved(srcPosition, targetPosition) } } } diff --git a/app/src/main/java/io/legado/app/service/help/ReadBook.kt b/app/src/main/java/io/legado/app/service/help/ReadBook.kt index dd68512fd..c4fb40204 100644 --- a/app/src/main/java/io/legado/app/service/help/ReadBook.kt +++ b/app/src/main/java/io/legado/app/service/help/ReadBook.kt @@ -90,10 +90,11 @@ object ReadBook { nextTextChapter = null } - fun uploadProgress() { - if (!AppConfig.syncBookProgress) return - book?.let { - BookWebDav.uploadBookProgress(it) + fun uploadProgress(syncBookProgress: Boolean = AppConfig.syncBookProgress) { + if (syncBookProgress) { + book?.let { + BookWebDav.uploadBookProgress(it) + } } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index b7801ae09..6d7eecd02 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -162,8 +162,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } } - fun syncBookProgress(book: Book) { - if (!AppConfig.syncBookProgress) + fun syncBookProgress(book: Book, syncBookProgress: Boolean = AppConfig.syncBookProgress) { + if (syncBookProgress) execute { BookWebDav.getBookProgress(book)?.let { progress -> if (progress.durChapterIndex < book.durChapterIndex ||