优化
This commit is contained in:
@@ -230,6 +230,8 @@ class PageView(context: Context) : FrameLayout(context) {
|
|||||||
val time = timeFormat.format(Date(System.currentTimeMillis()))
|
val time = timeFormat.format(Date(System.currentTimeMillis()))
|
||||||
tvTimeBattery?.setBattery(battery, time)
|
tvTimeBattery?.setBattery(battery, time)
|
||||||
tvTimeBatteryP?.text = "$time $battery%"
|
tvTimeBatteryP?.text = "$time $battery%"
|
||||||
|
destroyDrawingCache()
|
||||||
|
buildDrawingCache()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setContent(textPage: TextPage, resetPageOffset: Boolean = true) {
|
fun setContent(textPage: TextPage, resetPageOffset: Boolean = true) {
|
||||||
@@ -238,6 +240,8 @@ class PageView(context: Context) : FrameLayout(context) {
|
|||||||
resetPageOffset()
|
resetPageOffset()
|
||||||
}
|
}
|
||||||
binding.contentTextView.setContent(textPage)
|
binding.contentTextView.setContent(textPage)
|
||||||
|
destroyDrawingCache()
|
||||||
|
buildDrawingCache()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setContentDescription(content: String) {
|
fun setContentDescription(content: String) {
|
||||||
|
|||||||
@@ -439,9 +439,6 @@ class ReadView(context: Context, attrs: AttributeSet) :
|
|||||||
|
|
||||||
fun upPageAnim() {
|
fun upPageAnim() {
|
||||||
isScroll = ReadBook.pageAnim() == 3
|
isScroll = ReadBook.pageAnim() == 3
|
||||||
prevPage.isDrawingCacheEnabled = !isScroll
|
|
||||||
curPage.isDrawingCacheEnabled = !isScroll
|
|
||||||
nextPage.isDrawingCacheEnabled = !isScroll
|
|
||||||
ChapterProvider.upLayout()
|
ChapterProvider.upLayout()
|
||||||
when (ReadBook.pageAnim()) {
|
when (ReadBook.pageAnim()) {
|
||||||
PageAnim.coverPageAnim -> if (pageDelegate !is CoverPageDelegate) {
|
PageAnim.coverPageAnim -> if (pageDelegate !is CoverPageDelegate) {
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ abstract class HorizontalPageDelegate(readView: ReadView) : PageDelegate(readVie
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun onScroll(event: MotionEvent) {
|
private fun onScroll(event: MotionEvent) {
|
||||||
|
|
||||||
val action: Int = event.action
|
val action: Int = event.action
|
||||||
val pointerUp =
|
val pointerUp =
|
||||||
action and MotionEvent.ACTION_MASK == MotionEvent.ACTION_POINTER_UP
|
action and MotionEvent.ACTION_MASK == MotionEvent.ACTION_POINTER_UP
|
||||||
|
|||||||
Reference in New Issue
Block a user