[Android] Fix default orientation when device is held reversed
Nicolas Pomepuy
git at videolan.org
Wed Oct 21 09:02:40 CEST 2020
vlc-android | branch: 3.3.x | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Oct 9 07:43:24 2020 +0200| [6b920c21ea25e309b47b58c6c8a5a01343920fc8] | committer: Nicolas Pomepuy
Fix default orientation when device is held reversed
Fixes #1494
(cherry picked from commit ad1afc525d53bc0b4893c9500682daebc8149565)
> https://code.videolan.org/videolan/vlc-android/commit/6b920c21ea25e309b47b58c6c8a5a01343920fc8
---
.../vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index e1fff74f06..c5c68fe5f7 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -401,7 +401,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
val screenOrientationSetting = Integer.valueOf(settings.getString(SCREEN_ORIENTATION, "99" /*SCREEN ORIENTATION SENSOR*/)!!)
orientationMode = when (screenOrientationSetting) {
99 -> PlayerOrientationMode(false)
- 101 -> PlayerOrientationMode(true, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
+ 101 -> PlayerOrientationMode(true, if (windowManager.defaultDisplay.rotation == Surface.ROTATION_90) ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE else ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE)
102 -> PlayerOrientationMode(true, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
else -> PlayerOrientationMode(true, getOrientationForLock())
}
More information about the Android
mailing list