|
|
|
@ -164,16 +164,24 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at |
|
|
|
|
|
|
|
|
|
pageOffset += offset |
|
|
|
|
if (pageOffset > 0) { |
|
|
|
|
if (!pageFactory.hasPrev()) { |
|
|
|
|
pageOffset = 0f |
|
|
|
|
} else { |
|
|
|
|
pageFactory.moveToPrev() |
|
|
|
|
textPage = pageFactory.currentPage |
|
|
|
|
pageOffset -= textPage.height |
|
|
|
|
upView?.invoke(textPage) |
|
|
|
|
} |
|
|
|
|
} else if (pageOffset < -textPage.height) { |
|
|
|
|
if (!pageFactory.hasNext()) { |
|
|
|
|
pageOffset = -textPage.height.toFloat() |
|
|
|
|
} else { |
|
|
|
|
pageOffset += textPage.height |
|
|
|
|
pageFactory.moveToNext() |
|
|
|
|
textPage = pageFactory.currentPage |
|
|
|
|
upView?.invoke(textPage) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
invalidate() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|