diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 7bf8ec04a..3a564b3fa 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -4,7 +4,8 @@ **2020/02/28** * 解决阅读界面部分字体超出范围的问题 -* +* 修复背景切换有时空白的bug +* 修复滚动翻页问题 **2020/02/27** * 修复bug,边距调节,换源等一些bug,记不清了 diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 35f43c811..1bd474c89 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -164,15 +164,23 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at pageOffset += offset if (pageOffset > 0) { - pageFactory.moveToPrev() - textPage = pageFactory.currentPage - pageOffset -= textPage.height - upView?.invoke(textPage) + if (!pageFactory.hasPrev()) { + pageOffset = 0f + } else { + pageFactory.moveToPrev() + textPage = pageFactory.currentPage + pageOffset -= textPage.height + upView?.invoke(textPage) + } } else if (pageOffset < -textPage.height) { - pageOffset += textPage.height - pageFactory.moveToNext() - textPage = pageFactory.currentPage - upView?.invoke(textPage) + if (!pageFactory.hasNext()) { + pageOffset = -textPage.height.toFloat() + } else { + pageOffset += textPage.height + pageFactory.moveToNext() + textPage = pageFactory.currentPage + upView?.invoke(textPage) + } } invalidate() }