From 6d871afd868fa41bf51f80abeb53479a84a3d176 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 16 Dec 2020 10:23:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) } } } From 91504bbe57f15ade4fa03e7e07bc90427c0a695d Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 16 Dec 2020 10:51:49 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..9be53336f 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 @@ -163,7 +163,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } fun syncBookProgress(book: Book) { - if (!AppConfig.syncBookProgress) + if (AppConfig.syncBookProgress) execute { BookWebDav.getBookProgress(book)?.let { progress -> if (progress.durChapterIndex < book.durChapterIndex || From 778855b7fa595621ecef0462b978c5a0d1b5eef3 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 16 Dec 2020 10:58:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/service/help/ReadBook.kt | 9 +++++---- .../java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) 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 9be53336f..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 ||