Przeglądaj źródła

谷歌 为什么你的Slider不能处理越界

HapeLee 1 rok temu
rodzic
commit
5db8936e57

+ 8 - 3
app/src/main/java/io/legato/kazusa/ui/book/manga/ReadMangaActivity.kt

@@ -333,9 +333,14 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangaBinding, ReadMangaViewMode
                     mLayoutManager.scrollToPositionWithOffset(pos, 0)
                     mLayoutManager.scrollToPositionWithOffset(pos, 0)
                     binding.flLoading.isGone = true
                     binding.flLoading.isGone = true
                     loadMoreView.visible()
                     loadMoreView.visible()
-                    binding.mangaMenu.upSeekBar(
-                        ReadManga.durChapterPos, ReadManga.curMangaChapter!!.imageCount
-                    )
+                    val chapter = ReadManga.curMangaChapter
+                    if (chapter != null && chapter.imageCount > 0) {
+                        binding.mangaMenu.upSeekBar(
+                            ReadManga.durChapterPos, chapter.imageCount
+                        )
+                    } else {
+                        binding.mangaMenu.upSeekBar(1, 2)
+                    }
                 }
                 }
 
 
                 if (curFinish) {
                 if (curFinish) {