From cf0c68812dfd27b7bb7c8d981abb682f151edc25 Mon Sep 17 00:00:00 2001 From: acite <1498045907@qq.com> Date: Sat, 27 Sep 2025 17:31:22 +0800 Subject: [PATCH] [update] Set gesture protection for the bottom of the screen --- .../acitelight/aether/view/VideoPlayerLandscape.kt | 12 ++++++++---- .../aether/viewModel/VideoPlayerViewModel.kt | 4 +--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/acitelight/aether/view/VideoPlayerLandscape.kt b/app/src/main/java/com/acitelight/aether/view/VideoPlayerLandscape.kt index 8f6afdf..b250c8b 100644 --- a/app/src/main/java/com/acitelight/aether/view/VideoPlayerLandscape.kt +++ b/app/src/main/java/com/acitelight/aether/view/VideoPlayerLandscape.kt @@ -107,17 +107,21 @@ fun VideoPlayerLandscape(videoPlayerViewModel: VideoPlayerViewModel) { detectDragGestures( onDragStart = { offset -> if (videoPlayerViewModel.locked) return@detectDragGestures - if (offset.x < size.width / 2) { - videoPlayerViewModel.draggingPurpose = -1; + if(offset.y > size.height * 0.8 || offset.y < size.height * 0.2) + videoPlayerViewModel.draggingPurpose = -3 + // Set gesture protection for the bottom of the screen + // (Prevent conflicts with system gestures, such as dropdown status bar, bottom swipe up menu) + else if (offset.x < size.width / 2) { + videoPlayerViewModel.draggingPurpose = -1 } else { - videoPlayerViewModel.draggingPurpose = -2; + videoPlayerViewModel.draggingPurpose = -2 } }, onDragEnd = { if (videoPlayerViewModel.isPlaying && videoPlayerViewModel.draggingPurpose == 0) exoPlayer.play() - videoPlayerViewModel.draggingPurpose = -1; + videoPlayerViewModel.draggingPurpose = -1 }, onDrag = { change, dragAmount -> if (videoPlayerViewModel.locked) return@detectDragGestures diff --git a/app/src/main/java/com/acitelight/aether/viewModel/VideoPlayerViewModel.kt b/app/src/main/java/com/acitelight/aether/viewModel/VideoPlayerViewModel.kt index aa3acbc..7cf8bbb 100644 --- a/app/src/main/java/com/acitelight/aether/viewModel/VideoPlayerViewModel.kt +++ b/app/src/main/java/com/acitelight/aether/viewModel/VideoPlayerViewModel.kt @@ -89,7 +89,6 @@ class VideoPlayerViewModel @Inject constructor( var brit by mutableFloatStateOf(0.0f) val database: VideoRecordDatabase = VideoRecordDatabase.getDatabase(context) var cues by mutableStateOf(listOf()) - var currentKlass = mutableStateOf("") var currentId = mutableStateOf("") var currentName = mutableStateOf("") @@ -104,7 +103,7 @@ class VideoPlayerViewModel @Inject constructor( val oId = videoId.hexToString() var spec = "-1" - var vs = mutableListOf>() + var vs: MutableList> if(oId.contains("|")) { @@ -126,7 +125,6 @@ class VideoPlayerViewModel @Inject constructor( val ii = database.userDao().getAll().first() val ix = ii.filter { it.id in videos.map{ m -> m.id } }.maxByOrNull { it.time } - startPlay( if(spec != "-1") videos.first { it.id == spec}