[Android] Fix audio player menu visibility
Nicolas Pomepuy
git at videolan.org
Mon Apr 29 10:31:03 CEST 2019
vlc-android | branch: 3.1.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Apr 25 11:53:44 2019 +0200| [9e18c70c316cc292766ffe0dbd91f11f612648e3] | committer: Geoffrey Métais
Fix audio player menu visibility
(cherry picked from commit 242f2f5c90bac7d6a42700476e3c30e867080003)
> https://code.videolan.org/videolan/vlc-android/commit/9e18c70c316cc292766ffe0dbd91f11f612648e3
---
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index 25afb234e..a8dc33f7a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -24,6 +24,7 @@ import android.Manifest
import android.annotation.TargetApi
import android.content.Context
import android.content.SharedPreferences
+import android.content.res.Configuration
import android.net.Uri
import android.os.Build
import android.os.Bundle
@@ -151,6 +152,11 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher {
binding.timeline.setOnSeekBarChangeListener(timelineListener)
}
+ override fun onResume() {
+ onStateChanged(playerState)
+ super.onResume()
+ }
+
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
outState.putInt("player_state", playerState)
@@ -366,7 +372,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher {
headerTimeVisible: Boolean, searchVisible: Boolean,
filter: Boolean = false) {
this.advFuncVisible = !filter && advFuncVisible
- this.playlistSwitchVisible = !filter && playlistSwitchVisible
+ this.playlistSwitchVisible = !filter && playlistSwitchVisible && resources.configuration.orientation != Configuration.ORIENTATION_LANDSCAPE
this.headerPlayPauseVisible = !filter && headerPlayPauseVisible
this.progressBarVisible = !filter && progressBarVisible
this.headerTimeVisible = !filter && headerTimeVisible
More information about the Android
mailing list