[Android] Prevent volume and brightness sliders to be shown together

Nicolas Pomepuy git at videolan.org
Wed Aug 5 14:25:24 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Aug  4 07:29:26 2020 +0200| [b4075147c8d99d97c10b6b7037f93e222119a285] | committer: Nicolas Pomepuy

Prevent volume and brightness sliders to be shown together

Fixes #1440

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

 .../src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt         | 4 ++--
 .../src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt      | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index a67c1d817..0857f5c3f 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -309,7 +309,7 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
             binding.optionTitle.text = null
             binding.optionIcon.setImageResource(UiTools.getResourceFromAttribute(activity, R.attr.ic_audiodelay))
         } else {
-            binding.optionTitle.text = String.format("%s ms", java.lang.Long.toString(audiodelay))
+            binding.optionTitle.text = String.format("%s ms", audiodelay.toString())
             binding.optionIcon.setImageResource(R.drawable.ic_audiodelay_on)
         }
     }
@@ -320,7 +320,7 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
             binding.optionTitle.text = null
             binding.optionIcon.setImageResource(UiTools.getResourceFromAttribute(activity, R.attr.ic_subtitledelay))
         } else {
-            binding.optionTitle.text = String.format("%s ms", java.lang.Long.toString(spudelay))
+            binding.optionTitle.text = String.format("%s ms", spudelay.toString())
             binding.optionIcon.setImageResource(R.drawable.ic_subtitledelay_on)
         }
     }
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 30ccd9da2..4e3f05c93 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
@@ -182,6 +182,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
      * @param brightness the brightness value
      */
     fun showBrightnessBar(brightness: Int) {
+        player.handler.sendEmptyMessage(VideoPlayerActivity.FADE_OUT_VOLUME_INFO)
         player.findViewById<ViewStubCompat>(R.id.player_brightness_stub)?.setVisible()
         playerOverlayBrightness = player.findViewById(R.id.player_overlay_brightness)
         brightnessValueText = player.findViewById(R.id.brightness_value_text)
@@ -201,6 +202,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
      * @param volume the volume value
      */
     fun showVolumeBar(volume: Int, fromTouch: Boolean) {
+        player.handler.sendEmptyMessage(VideoPlayerActivity.FADE_OUT_BRIGHTNESS_INFO)
         player.findViewById<ViewStubCompat>(R.id.player_volume_stub)?.setVisible()
         playerOverlayVolume = player.findViewById(R.id.player_overlay_volume)
         volumeValueText = player.findViewById(R.id.volume_value_text)



More information about the Android mailing list