From c77a4d08d68a6f2a590e6498ba1f6c43c65d5d60 Mon Sep 17 00:00:00 2001 From: Kai Date: Thu, 12 Dec 2024 23:01:28 -0600 Subject: [PATCH] increase delay to prevent erroneous rotations --- .../fragment/mainactivity/main/VideoDetailFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailFragment.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailFragment.kt index 776c4512..23e7a0c0 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailFragment.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailFragment.kt @@ -388,11 +388,13 @@ class VideoDetailFragment() : MainFragment() { updateOrientation() } + val delayBeforeRemoveRotationLock = 800L + _landscapeOrientationListener = LandscapeOrientationListener(requireContext()) { CoroutineScope(Dispatchers.Main).launch { // delay to make sure that the system auto rotate updates - delay(300) + delay(delayBeforeRemoveRotationLock) _lastSetOrientation = Configuration.ORIENTATION_LANDSCAPE updateOrientation() } @@ -401,7 +403,7 @@ class VideoDetailFragment() : MainFragment() { { CoroutineScope(Dispatchers.Main).launch { // delay to make sure that the system auto rotate updates - delay(300) + delay(delayBeforeRemoveRotationLock) _lastSetOrientation = Configuration.ORIENTATION_PORTRAIT updateOrientation() }