[Android] Fix IllegalStateException

Nicolas Pomepuy git at videolan.org
Wed Jul 1 14:21:05 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Jul  1 07:05:58 2020 +0200| [46af55f50a0efe73bca022ae9f7147a036a54a4c] | committer: Nicolas Pomepuy

Fix IllegalStateException

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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 62934ea9d..c278eb590 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
@@ -1313,9 +1313,9 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
      */
     private fun showBrightnessBar(brightness: Int) {
         findViewById<ViewStubCompat>(R.id.player_brightness_stub)?.setVisible()
-        if (player_overlay_brightness.visibility != View.VISIBLE) hapticFeedback()
+        if (player_overlay_brightness?.visibility != View.VISIBLE) hapticFeedback()
         player_overlay_brightness.setVisible()
-        brightness_value_text.text = "$brightness%"
+        brightness_value_text?.text = "$brightness%"
         playerBrightnessProgress.setValue(brightness)
         player_overlay_brightness.setVisible()
         handler.removeMessages(FADE_OUT_BRIGHTNESS_INFO)
@@ -1329,11 +1329,11 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
      */
     private fun showVolumeBar(volume: Int) {
         findViewById<ViewStubCompat>(R.id.player_volume_stub)?.setVisible()
-        if (player_overlay_volume.visibility != View.VISIBLE)  hapticFeedback()
+        if (player_overlay_volume?.visibility != View.VISIBLE)  hapticFeedback()
         volume_value_text.text = "$volume%"
         playerVolumeProgress.isDouble = isAudioBoostEnabled
         playerVolumeProgress.setValue(volume)
-        player_overlay_volume.setVisible()
+        player_overlay_volume?.setVisible()
         handler.removeMessages(FADE_OUT_VOLUME_INFO)
         handler.sendEmptyMessageDelayed(FADE_OUT_VOLUME_INFO, 1000L)
         dimStatusBar(true)



More information about the Android mailing list