[Android] Fix the screenshot and orientation buttons visibility in locked mode
Nicolas Pomepuy
git at videolan.org
Thu Nov 20 06:23:37 UTC 2025
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Nov 4 08:02:48 2025 +0100| [74744bb47a5ec025b3b1905000787da1a52e982f] | committer: Nicolas Pomepuy
Fix the screenshot and orientation buttons visibility in locked mode
> https://code.videolan.org/videolan/vlc-android/commit/74744bb47a5ec025b3b1905000787da1a52e982f
---
.../org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
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 5cc0b5b80c..ebb00d6641 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
@@ -762,7 +762,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
hudBinding.orientationToggle.setImageDrawable(ContextCompat.getDrawable(player, drawable))
}
if (::hudRightBinding.isInitialized) {
- if (player.orientationMode.locked && Settings.getInstance(player).getBoolean(SHOW_ORIENTATION_BUTTON, true)) {
+ if (!player.isLocked && player.orientationMode.locked && Settings.getInstance(player).getBoolean(SHOW_ORIENTATION_BUTTON, true)) {
val drawable = if (player.orientationMode.orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || player.orientationMode.orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE || player.orientationMode.orientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) {
R.drawable.ic_player_lock_landscape
} else {
@@ -877,7 +877,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
}
fun updateScreenshotButton() {
- hudRightBinding.playerScreenshot.visibility = if (Settings.getInstance(player).getString(SCREENSHOT_MODE, "0") in arrayOf("1", "3")) View.VISIBLE else View.GONE
+ hudRightBinding.playerScreenshot.visibility = if (!player.isLocked && Settings.getInstance(player).getString(SCREENSHOT_MODE, "0") in arrayOf("1", "3")) View.VISIBLE else View.GONE
hudRightBinding.playerScreenshot.setOnClickListener(player)
}
@@ -964,7 +964,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
hudRightBinding.videoSecondaryDisplay.contentDescription = player.resources.getString(if (secondary) R.string.video_remote_disable else R.string.video_remote_enable)
hudRightBinding.playlistToggle.visibility = if (show && player.service?.hasPlaylist() == true) View.VISIBLE else View.GONE
- hudRightBinding.playerScreenshot.visibility = if (Settings.getInstance(player).getString(SCREENSHOT_MODE, "0") in arrayOf("1", "3")) View.VISIBLE else View.GONE
+ hudRightBinding.playerScreenshot.visibility = if (!player.isLocked && Settings.getInstance(player).getString(SCREENSHOT_MODE, "0") in arrayOf("1", "3")) View.VISIBLE else View.GONE
hudRightBinding.playerOverlayNavmenu.visibility = if (player.menuIdx >= 0) View.VISIBLE else View.GONE
hudRightBinding.sleepQuickAction.visibility = if (show && PlaybackService.playerSleepTime.value != null) View.VISIBLE else View.GONE
@@ -1072,6 +1072,8 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
hideOverlay(true)
player.lockBackButton = true
player.isLocked = true
+ updateOrientationIcon()
+ updateScreenshotButton()
}
/**
@@ -1091,10 +1093,11 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
hudBinding.playlistNext.isEnabled = true
hudBinding.playlistPrevious.isEnabled = true
}
- updateOrientationIcon()
player.isShowing = false
player.isLocked = false
showOverlay()
+ updateOrientationIcon()
+ updateScreenshotButton()
player.lockBackButton = false
}
More information about the Android
mailing list