[Android] Fix audio player menu visibility
Nicolas Pomepuy
git at videolan.org
Fri Apr 26 16:18:14 CEST 2019
vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Apr 25 11:53:44 2019 +0200| [242f2f5c90bac7d6a42700476e3c30e867080003] | committer: Geoffrey Métais
Fix audio player menu visibility
> https://code.videolan.org/videolan/vlc-android/commit/242f2f5c90bac7d6a42700476e3c30e867080003
---
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 e5916cc58..5f7d9f1a5 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