[Android] Bookmarks: reinitialize the layout on rotation

Duncan McNamara git at videolan.org
Wed Apr 27 06:26:59 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Apr 26 18:23:20 2022 +0200| [6052be5d6cdf86af81038b469deebcfec09b55f7] | committer: Duncan McNamara

Bookmarks: reinitialize the layout on rotation

Fixes #2489

> https://code.videolan.org/videolan/vlc-android/commit/6052be5d6cdf86af81038b469deebcfec09b55f7
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt          | 1 +
 .../src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt   | 7 +++++++
 2 files changed, 8 insertions(+)

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 88f56299a..d1027ebde 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
@@ -705,6 +705,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
         statsDelegate.onConfigurationChanged()
         overlayDelegate.updateHudMargins()
         overlayDelegate.updateTitleConstraints()
+        overlayDelegate.rotateBookmarks()
     }
 
     override fun onStart() {
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
index 4a32d9f82..0be283f6a 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
@@ -939,6 +939,13 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
         }
     }
 
+    fun rotateBookmarks() {
+        if (::bookmarkListDelegate.isInitialized && isBookmarkShown()) {
+            bookmarkListDelegate.hide()
+            showBookmarks()
+        }
+    }
+
     fun isBookmarkShown() = ::bookmarkListDelegate.isInitialized && bookmarkListDelegate.visible
     fun hideBookmarks() {
         bookmarkListDelegate.hide()



More information about the Android mailing list