increase delay to prevent erroneous rotations

This commit is contained in:
Kai 2024-12-12 23:01:28 -06:00
parent 9b3f90f922
commit c77a4d08d6
No known key found for this signature in database

View File

@ -388,11 +388,13 @@ class VideoDetailFragment() : MainFragment() {
updateOrientation() updateOrientation()
} }
val delayBeforeRemoveRotationLock = 800L
_landscapeOrientationListener = LandscapeOrientationListener(requireContext()) _landscapeOrientationListener = LandscapeOrientationListener(requireContext())
{ {
CoroutineScope(Dispatchers.Main).launch { CoroutineScope(Dispatchers.Main).launch {
// delay to make sure that the system auto rotate updates // delay to make sure that the system auto rotate updates
delay(300) delay(delayBeforeRemoveRotationLock)
_lastSetOrientation = Configuration.ORIENTATION_LANDSCAPE _lastSetOrientation = Configuration.ORIENTATION_LANDSCAPE
updateOrientation() updateOrientation()
} }
@ -401,7 +403,7 @@ class VideoDetailFragment() : MainFragment() {
{ {
CoroutineScope(Dispatchers.Main).launch { CoroutineScope(Dispatchers.Main).launch {
// delay to make sure that the system auto rotate updates // delay to make sure that the system auto rotate updates
delay(300) delay(delayBeforeRemoveRotationLock)
_lastSetOrientation = Configuration.ORIENTATION_PORTRAIT _lastSetOrientation = Configuration.ORIENTATION_PORTRAIT
updateOrientation() updateOrientation()
} }