|
|
@ -12,6 +12,7 @@ import android.widget.Scroller |
|
|
|
import androidx.annotation.CallSuper |
|
|
|
import androidx.annotation.CallSuper |
|
|
|
import com.google.android.material.snackbar.Snackbar |
|
|
|
import com.google.android.material.snackbar.Snackbar |
|
|
|
import io.legado.app.help.AppConfig |
|
|
|
import io.legado.app.help.AppConfig |
|
|
|
|
|
|
|
import io.legado.app.help.ReadBookConfig |
|
|
|
import io.legado.app.ui.book.read.page.ContentView |
|
|
|
import io.legado.app.ui.book.read.page.ContentView |
|
|
|
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 io.legado.app.utils.screenshot |
|
|
@ -193,6 +194,10 @@ abstract class PageDelegate(protected val pageView: PageView) : |
|
|
|
|
|
|
|
|
|
|
|
open fun onScroll() {}//移动contentView, slidePage |
|
|
|
open fun onScroll() {}//移动contentView, slidePage |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract fun nextPageByAnim() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract fun prevPageByAnim() |
|
|
|
|
|
|
|
|
|
|
|
@CallSuper |
|
|
|
@CallSuper |
|
|
|
open fun setDirection(direction: Direction) { |
|
|
|
open fun setDirection(direction: Direction) { |
|
|
|
mDirection = direction |
|
|
|
mDirection = direction |
|
|
@ -260,21 +265,14 @@ abstract class PageDelegate(protected val pageView: PageView) : |
|
|
|
if (centerRectF.contains(x, y)) { |
|
|
|
if (centerRectF.contains(x, y)) { |
|
|
|
pageView.callBack.clickCenter() |
|
|
|
pageView.callBack.clickCenter() |
|
|
|
setTouchPoint(x, y) |
|
|
|
setTouchPoint(x, y) |
|
|
|
} else { |
|
|
|
} else if (ReadBookConfig.clickTurnPage) { |
|
|
|
if (x > viewWidth / 2 || |
|
|
|
if (x > viewWidth / 2 || |
|
|
|
AppConfig.clickAllNext |
|
|
|
AppConfig.clickAllNext |
|
|
|
) { |
|
|
|
) { |
|
|
|
//设置动画方向 |
|
|
|
nextPageByAnim() |
|
|
|
if (!hasNext()) return true |
|
|
|
|
|
|
|
setDirection(Direction.NEXT) |
|
|
|
|
|
|
|
setBitmap() |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (!hasPrev()) return true |
|
|
|
prevPageByAnim() |
|
|
|
setDirection(Direction.PREV) |
|
|
|
|
|
|
|
setBitmap() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
setTouchPoint(x, y) |
|
|
|
|
|
|
|
onAnimStart() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|