|
|
@ -4,6 +4,7 @@ import android.graphics.* |
|
|
|
import android.graphics.drawable.GradientDrawable |
|
|
|
import android.graphics.drawable.GradientDrawable |
|
|
|
import android.os.Build |
|
|
|
import android.os.Build |
|
|
|
import io.legado.app.ui.book.read.page.PageView |
|
|
|
import io.legado.app.ui.book.read.page.PageView |
|
|
|
|
|
|
|
import io.legado.app.utils.screenshot |
|
|
|
import kotlin.math.* |
|
|
|
import kotlin.math.* |
|
|
|
|
|
|
|
|
|
|
|
@Suppress("DEPRECATION") |
|
|
|
@Suppress("DEPRECATION") |
|
|
@ -87,7 +88,6 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi |
|
|
|
override fun setTouchPoint(x: Float, y: Float, invalidate: Boolean) { |
|
|
|
override fun setTouchPoint(x: Float, y: Float, invalidate: Boolean) { |
|
|
|
super.setTouchPoint(x, y, invalidate) |
|
|
|
super.setTouchPoint(x, y, invalidate) |
|
|
|
//触摸y中间位置吧y变成屏幕高度 |
|
|
|
//触摸y中间位置吧y变成屏幕高度 |
|
|
|
//触摸y中间位置吧y变成屏幕高度 |
|
|
|
|
|
|
|
if ((startY > pageView.height / 3.0 |
|
|
|
if ((startY > pageView.height / 3.0 |
|
|
|
&& startY < pageView.height * 2 / 3.0) |
|
|
|
&& startY < pageView.height * 2 / 3.0) |
|
|
|
|| mDirection == Direction.PREV |
|
|
|
|| mDirection == Direction.PREV |
|
|
@ -123,6 +123,20 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun setBitmap() { |
|
|
|
|
|
|
|
when (mDirection) { |
|
|
|
|
|
|
|
Direction.PREV -> { |
|
|
|
|
|
|
|
prevBitmap = prevPage.screenshot() |
|
|
|
|
|
|
|
curBitmap = curPage.screenshot() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Direction.NEXT -> { |
|
|
|
|
|
|
|
nextBitmap = nextPage.screenshot() |
|
|
|
|
|
|
|
curBitmap = curPage.screenshot() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else -> Unit |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onScrollStart() { |
|
|
|
override fun onScrollStart() { |
|
|
|
val distanceX: Float |
|
|
|
val distanceX: Float |
|
|
|
when (mDirection) { |
|
|
|
when (mDirection) { |
|
|
|