[Android] Fix sort order icon when the default sort is used

Nicolas Pomepuy git at videolan.org
Mon May 9 11:39:03 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri May  6 12:55:29 2022 +0200| [7b746bc717928fcdebf9d1260bc81b385690ba60] | committer: Duncan McNamara

Fix sort order icon when the default sort is used

Fixes #2510

> https://code.videolan.org/videolan/vlc-android/commit/7b746bc717928fcdebf9d1260bc81b385690ba60
---

 application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
index a6aa39cd9..ab6cc059e 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
@@ -580,7 +580,7 @@ object UiTools {
         val sort = provider.sort
         val desc = provider.desc
         var item: MenuItem? = menu.findItem(R.id.ml_menu_sortby_name)
-        item?.title = "${provider.context.getString(R.string.sortby_name)} ${if (sort == Medialibrary.SORT_ALPHA && !desc) "▼" else ""}"
+        item?.title = "${provider.context.getString(R.string.sortby_name)} ${if (sort == Medialibrary.SORT_ALPHA || sort == Medialibrary.SORT_DEFAULT && !desc) "▼" else ""}"
         item = menu.findItem(R.id.ml_menu_sortby_filename)
         item?.title = "${provider.context.getString(R.string.sortby_filename)} ${if (sort == Medialibrary.SORT_FILENAME && !desc) "▼" else ""}"
         item = menu.findItem(R.id.ml_menu_sortby_artist_name)
@@ -604,7 +604,7 @@ object UiTools {
         val sort = model.sort
         val desc = model.desc
         var item: MenuItem? = menu.findItem(R.id.ml_menu_sortby_name)
-        item?.title = "${sortable.requireContext().getString(R.string.sortby_name)} ${if (sort == Medialibrary.SORT_ALPHA && !desc) "▼" else ""}"
+        item?.title = "${sortable.requireContext().getString(R.string.sortby_name)} ${if (sort == Medialibrary.SORT_ALPHA || sort == Medialibrary.SORT_DEFAULT && !desc) "▼" else ""}"
         item = menu.findItem(R.id.ml_menu_sortby_filename)
         item?.title = "${sortable.requireContext().getString(R.string.sortby_filename)} ${if (sort == Medialibrary.SORT_FILENAME && !desc) "▼" else ""}"
         item = menu.findItem(R.id.ml_menu_sortby_artist_name)



More information about the Android mailing list