[Android] Fix initial value of the browser sort when opening the display settings

Nicolas Pomepuy git at videolan.org
Mon May 13 13:13:55 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon May 13 15:00:39 2024 +0200| [2176328541cb020a04ada3a19b3e177a4ff3c080] | committer: Nicolas Pomepuy

Fix initial value of the browser sort when opening the display settings

> https://code.videolan.org/videolan/vlc-android/commit/2176328541cb020a04ada3a19b3e177a4ff3c080
---

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

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index 2f335538e7..648f433d2d 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -638,7 +638,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
                         displayInCards = inCards,
                         onlyFavs = null,
                         sorts = sorts,
-                        currentSort = viewModel.provider.sort,
+                        currentSort = viewModel.provider.sort.takeIf { it != 0 } ?: Medialibrary.SORT_FILENAME,
                         currentSortDesc = viewModel.provider.desc,
                         showOnlyMultimediaFiles = settings.getBoolean(BROWSER_SHOW_ONLY_MULTIMEDIA, false),
                         showHiddenFiles = settings.getBoolean(BROWSER_SHOW_HIDDEN_FILES, true)



More information about the Android mailing list