|
|
@ -3,6 +3,7 @@ package io.legado.app.ui.widget.page.delegate |
|
|
|
import android.graphics.Bitmap |
|
|
|
import android.graphics.Bitmap |
|
|
|
import android.graphics.Canvas |
|
|
|
import android.graphics.Canvas |
|
|
|
import android.graphics.RectF |
|
|
|
import android.graphics.RectF |
|
|
|
|
|
|
|
import android.text.method.ScrollingMovementMethod |
|
|
|
import android.view.GestureDetector |
|
|
|
import android.view.GestureDetector |
|
|
|
import android.view.MotionEvent |
|
|
|
import android.view.MotionEvent |
|
|
|
import android.widget.Scroller |
|
|
|
import android.widget.Scroller |
|
|
@ -45,6 +46,10 @@ abstract class PageDelegate(protected val pageView: PageView) { |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private val scrollingMovementMethod: ScrollingMovementMethod by lazy { |
|
|
|
|
|
|
|
ScrollingMovementMethod() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private val detector: GestureDetector by lazy { |
|
|
|
private val detector: GestureDetector by lazy { |
|
|
|
GestureDetector( |
|
|
|
GestureDetector( |
|
|
|
pageView.context, |
|
|
|
pageView.context, |
|
|
@ -266,6 +271,7 @@ abstract class PageDelegate(protected val pageView: PageView) { |
|
|
|
distanceY: Float |
|
|
|
distanceY: Float |
|
|
|
): Boolean { |
|
|
|
): Boolean { |
|
|
|
curPage?.contentTextView()?.setTextIsSelectable(false) |
|
|
|
curPage?.contentTextView()?.setTextIsSelectable(false) |
|
|
|
|
|
|
|
curPage?.contentTextView()?.movementMethod = scrollingMovementMethod |
|
|
|
if (pageView.isScrollDelegate()) { |
|
|
|
if (pageView.isScrollDelegate()) { |
|
|
|
curPage?.dispatchTouchEvent(e2) |
|
|
|
curPage?.dispatchTouchEvent(e2) |
|
|
|
return true |
|
|
|
return true |
|
|
|