Forráskód Böngészése

fix: minor changes

Yaoliang 2 éve
szülő
commit
11a0e90462

+ 1 - 1
app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt

@@ -517,4 +517,4 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
 
 
     }
     }
 
 
-}
+}

+ 1 - 2
app/src/main/java/io/legado/app/ui/book/read/BaseReadBookActivity.kt

@@ -330,8 +330,7 @@ abstract class BaseReadBookActivity :
                             {  _, yy, mm, dayOfMonth ->
                             {  _, yy, mm, dayOfMonth ->
                                 // 使用Java 8的日期和时间API来格式化日期
                                 // 使用Java 8的日期和时间API来格式化日期
                                 val date = LocalDate.of(yy, mm + 1, dayOfMonth) // Java 8的LocalDate,月份从1开始
                                 val date = LocalDate.of(yy, mm + 1, dayOfMonth) // Java 8的LocalDate,月份从1开始
-                                val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
-                                val formattedDate = date.format(formatter)
+                                val formattedDate = date.format(dateFormatter)
                                 startDate.setText(formattedDate)
                                 startDate.setText(formattedDate)
                             }, localStartDate.year, localStartDate.monthValue - 1, localStartDate.dayOfMonth
                             }, localStartDate.year, localStartDate.monthValue - 1, localStartDate.dayOfMonth
                         )
                         )

+ 2 - 3
app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@@ -229,12 +229,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
             AppLog.put("拉取阅读进度失败《${book.name}》\n${it.localizedMessage}", it)
             AppLog.put("拉取阅读进度失败《${book.name}》\n${it.localizedMessage}", it)
         }.onSuccess { progress ->
         }.onSuccess { progress ->
             if (progress.durChapterIndex < book.durChapterIndex ||
             if (progress.durChapterIndex < book.durChapterIndex ||
-                progress.durChapterIndex >= book.simulatedTotalChapterNum() ||
                 (progress.durChapterIndex == book.durChapterIndex
                 (progress.durChapterIndex == book.durChapterIndex
                         && progress.durChapterPos < book.durChapterPos)
                         && progress.durChapterPos < book.durChapterPos)
             ) {
             ) {
                 alertSync?.invoke(progress)
                 alertSync?.invoke(progress)
-            } else {
+            } else if (progress.durChapterIndex < book.simulatedTotalChapterNum()) {
                 ReadBook.setProgress(progress)
                 ReadBook.setProgress(progress)
                 AppLog.put("自动同步阅读进度成功《${book.name}》 ${progress.durChapterTitle}")
                 AppLog.put("自动同步阅读进度成功《${book.name}》 ${progress.durChapterTitle}")
             }
             }
@@ -545,4 +544,4 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
         }
         }
     }
     }
 
 
-}
+}

+ 0 - 4
app/src/main/res/values-night/strings.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="start_chapter">Start Chapter</string>
-</resources>