pref: 看图切换页面阈值微调

This commit is contained in:
HuanCheng65 2023-07-18 23:12:34 +08:00
parent e5f4654e3e
commit 9f295fae35
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
2 changed files with 1 additions and 8 deletions

View File

@ -1,7 +0,0 @@
package com.huanchengfly.tieba.post.interfaces;
import android.view.MotionEvent;
public interface OnDispatchTouchEvent {
void onDispatchTouchEvent(MotionEvent event);
}

View File

@ -215,7 +215,7 @@ class PhotoViewActivity : BaseComposeActivityWithParcelable<PhotoViewData>() {
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
onDrag = { dx, dy, isAtEdge -> onDrag = { dx, dy, isAtEdge ->
val currentPage = pagerState.currentPage val currentPage = pagerState.currentPage
if (abs(dy) < 15 && abs(dx) > 25 && isAtEdge) { if (abs(dy) < 15 && abs(dx) > 30 && isAtEdge) {
val prevPage = currentPage - 1 val prevPage = currentPage - 1
val nextPage = currentPage + 1 val nextPage = currentPage + 1
if (dx > 0 && prevPage >= 0) { if (dx > 0 && prevPage >= 0) {