feat: 优化代码

pull/121/head
kunfei 5 years ago
parent 8152b4e879
commit 98b75d547b
  1. 3
      app/src/main/assets/updateLog.md
  2. 24
      app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt

@ -4,7 +4,8 @@
**2020/02/28**
* 解决阅读界面部分字体超出范围的问题
*
* 修复背景切换有时空白的bug
* 修复滚动翻页问题
**2020/02/27**
* 修复bug,边距调节,换源等一些bug,记不清了

@ -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()
}

Loading…
Cancel
Save