[Android] Fix Equalizer rotation issue in video player

Nicolas Pomepuy git at videolan.org
Mon Feb 14 07:09:51 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Feb 11 07:45:49 2022 +0100| [5a5214fb811f0b7a6e1ab149a28169d5a5ee6dec] | committer: Nicolas Pomepuy

Fix Equalizer rotation issue in video player

Fixes #2385

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

 .../src/org/videolan/vlc/gui/audio/EqualizerFragment.kt            | 7 ++++++-
 .../src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt      | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
index d644deaff..058bcdd7d 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
@@ -50,6 +50,7 @@ import org.videolan.vlc.BuildConfig
 import org.videolan.vlc.PlaybackService
 import org.videolan.vlc.R
 import org.videolan.vlc.databinding.EqualizerBinding
+import org.videolan.vlc.gui.dialogs.SelectChapterDialog
 import org.videolan.vlc.gui.dialogs.VLCBottomSheetDialogFragment
 import org.videolan.vlc.gui.helpers.UiTools
 import org.videolan.vlc.gui.view.EqualizerBar
@@ -62,7 +63,7 @@ import kotlin.math.roundToInt
 class EqualizerFragment : VLCBottomSheetDialogFragment(), Slider.OnChangeListener {
     override fun getDefaultState() = STATE_EXPANDED
 
-    override fun needToManageOrientation() = false
+    override fun needToManageOrientation() = true
 
     override fun initialFocusedView(): View = binding.equalizerContainer
 
@@ -503,6 +504,10 @@ class EqualizerFragment : VLCBottomSheetDialogFragment(), Slider.OnChangeListene
                 }
                 return presets.toTypedArray()
             }
+
+        fun newInstance(): EqualizerFragment {
+            return EqualizerFragment()
+        }
     }
 
     override fun onValueChange(slider: Slider, value: Float, fromUser: Boolean) {
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 0485164cc..2d51a77ac 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
@@ -245,7 +245,7 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
                 tag = "select_chapter"
             }
             ID_EQUALIZER -> {
-                newFragment = EqualizerFragment()
+                newFragment = EqualizerFragment.newInstance()
                 tag = "equalizer"
             }
             ID_SAVE_PLAYLIST -> {



More information about the Android mailing list