[Android] Display settings: fix default sort not selected

Nicolas Pomepuy git at videolan.org
Mon Mar 25 14:08:00 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Mar 21 08:18:29 2024 +0100| [1726d0f026b3454a9a5f07d663159f9c6b5e41a1] | committer: Nicolas Pomepuy

Display settings: fix default sort not selected

> https://code.videolan.org/videolan/vlc-android/commit/1726d0f026b3454a9a5f07d663159f9c6b5e41a1
---

 .../src/org/videolan/vlc/gui/dialogs/DisplaySettingsDialog.kt           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/DisplaySettingsDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/DisplaySettingsDialog.kt
index f852cbf169..ecdb32299e 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/DisplaySettingsDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/DisplaySettingsDialog.kt
@@ -260,7 +260,7 @@ class DisplaySettingsDialog : VLCBottomSheetDialogFragment() {
         binding.sortsContainer.children.forEach { container ->
             (container as ViewGroup).children.forEach childrenForEach@{
                 if (it.getTag(R.id.sort) == null) return at childrenForEach
-                val selected = it.getTag(R.id.sort) == getSortTag(currentSort, currentSortDesc)
+                val selected = it.getTag(R.id.sort) == getSortTag(currentSort, currentSortDesc) || (currentSort == Medialibrary.SORT_DEFAULT && it.getTag(R.id.sort) == getSortTag(Medialibrary.SORT_ALPHA, currentSortDesc))
                 it.isSelected = selected
                 (it as TextView).setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, if (selected) ContextCompat.getDrawable(requireActivity(), R.drawable.ic_check_large) else null, null)
             }



More information about the Android mailing list