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