[Android] Improve equalizer save dialog

Nicolas Pomepuy git at videolan.org
Wed Jun 5 10:31:31 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Jun  5 07:03:12 2019 +0200| [797ed0ae17d25112b2d67d302443d7515254de25] | committer: Geoffrey Métais

Improve equalizer save dialog

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

 .../src/org/videolan/vlc/gui/audio/EqualizerFragment.kt        | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
index fa7f46ce0..b628f271d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/EqualizerFragment.kt
@@ -57,7 +57,7 @@ class EqualizerFragment : VLCBottomSheetDialogFragment() {
 
     override fun needToManageOrientation() = false
 
-    override fun initialFocusedView() = binding.equalizerBands.getChildAt(0)
+    override fun initialFocusedView() = binding.equalizerButton
 
     private lateinit var equalizer: MediaPlayer.Equalizer
     private var customCount = 0
@@ -288,6 +288,12 @@ class EqualizerFragment : VLCBottomSheetDialogFragment() {
         input.setText(oldName)
         input.setSelectAllOnFocus(true)
 
+        val container = FrameLayout(context)
+        val klNormal = resources.getDimension(R.dimen.kl_normal).toInt()
+        container.setPadding(klNormal, 0, klNormal, 0)
+
+        container.addView(input)
+
         val saveEqualizer = AlertDialog.Builder(requireActivity())
                 .setTitle(resources.getString(if (displayedByUser)
                     R.string.custom_set_save_title
@@ -297,7 +303,7 @@ class EqualizerFragment : VLCBottomSheetDialogFragment() {
                     R.string.existing_custom_set_save_message
                 else
                     R.string.new_custom_set_save_message))
-                .setView(input)
+                .setView(container)
                 .setPositiveButton(R.string.save, null)
                 .setNegativeButton(R.string.do_not_save) { _, _ ->
                     if (onPause)



More information about the Android mailing list