[Android] Implement medialibrary sort icons
Nicolas Pomepuy
git at videolan.org
Wed Jun 5 11:51:01 UTC 2024
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Apr 25 11:00:49 2024 +0200| [f6288cacf274697e8bf42b4916e13a904576cbf6] | committer: Nicolas Pomepuy
Implement medialibrary sort icons
> https://code.videolan.org/videolan/vlc-android/commit/f6288cacf274697e8bf42b4916e13a904576cbf6
---
.../src/main/res/drawable/ic_medialibrary_date.xml | 11 +++++++++++
.../src/main/res/drawable/ic_medialibrary_scan.xml | 13 +++++++++++++
.../resources/src/main/res/drawable/ic_sort_scan.xml | 14 --------------
.../org/videolan/vlc/gui/dialogs/DisplaySettingsDialog.kt | 4 ++--
4 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/application/resources/src/main/res/drawable/ic_medialibrary_date.xml b/application/resources/src/main/res/drawable/ic_medialibrary_date.xml
new file mode 100644
index 0000000000..c1b1d5bdf5
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_medialibrary_date.xml
@@ -0,0 +1,11 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48"
+ android:viewportHeight="48">
+ <path
+ android:pathData="M24,6C22.704,6 21.277,6.46 20.27,7.445 19.262,8.431 18.653,9.719 18.104,11.367L10.559,34L9,34c-2.185,0 -4,1.815 -4,4v2c0,1.105 0.895,2 2,2h13c1.105,0 2,-0.895 2,-2 0,-1.105 -0.895,-2 -2,-2h-6.557l8.455,-25.367c0.451,-1.352 0.897,-2.063 1.168,-2.328C23.337,10.04 23.411,10 24,10c0.589,0 0.663,0.04 0.934,0.305 0.271,0.265 0.719,0.976 1.17,2.328l0.666,2c0.349,1.048 1.481,1.615 2.529,1.266 1.049,-0.349 1.616,-1.483 1.266,-2.531l-0.666,-2C29.349,9.719 28.738,8.431 27.73,7.445 26.723,6.46 25.296,6 24,6ZM30.465,20C29.653,20 29,20.669 29,21.5L29,22c-1.639,0 -3,1.361 -3,3v14c0,1.639 1.361,3 3,3h14c1.639,0 3,-1.361 3,-3L46,25c0,-1.639 -1.361,-3 -3,-3L43,21.5C43,20.669 42.347,20 41.535,20h-0.07C40.653,20 40,20.669 40,21.5L40,22L32,22L32,21.5C32,20.669 31.347,20 30.535,20ZM29,28L43,28L43,39L29,39ZM37,32c-0.554,0 -1,0.446 -1,1v3c0,0.554 0.446,1 1,1h3c0.554,0 1,-0.446 1,-1v-3c0,-0.554 -0.446,-1 -1,-1z"
+ android:fillColor="?attr/colorControlNormal"
+ tools:fillColor="#fff"/>
+</vector>
diff --git a/application/resources/src/main/res/drawable/ic_medialibrary_scan.xml b/application/resources/src/main/res/drawable/ic_medialibrary_scan.xml
new file mode 100644
index 0000000000..f3736452b1
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_medialibrary_scan.xml
@@ -0,0 +1,13 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48"
+ android:viewportHeight="48">
+ <path
+ tools:fillColor="#fff"
+ android:fillColor="?attr/colorControlNormal"
+ android:pathData="M24,6C22.704,6 21.277,6.46 20.27,7.445C19.262,8.431 18.653,9.719 18.104,11.367L10.559,34L9,34C6.815,34 5,35.815 5,38L5,40C5,41.105 5.895,42 7,42L21,42C22.105,42 23,41.105 23,40C23,38.895 22.105,38 21,38L13.441,38L21.896,12.633C22.347,11.281 22.796,10.569 23.066,10.305C23.337,10.04 23.411,10 24,10C24.589,10 24.663,10.04 24.934,10.305C25.204,10.569 25.653,11.281 26.104,12.633L26.102,12.633L27.143,15.758C27.492,16.807 28.625,17.374 29.674,17.023C30.723,16.674 31.29,15.541 30.939,14.492L29.898,11.367L29.896,11.367C29.347,9.719 28.738,8.431 27.73,7.445C26.723,6.46 25.296,6 24,6zM35,20C28.949,20 24,24.949 24,31C24,37.051 28.949,42 35,42A2,2 0,0 0,35.004 42C38.66,41.994 42.077,40.167 44.115,37.133A2,2 0,0 0,43.57 34.357A2,2 0,0 0,40.795 34.902C39.497,36.836 37.328,37.995 35,38C31.11,38 28,34.89 28,31C28,27.11 31.11,24 35,24C36.659,24.001 38.233,24.586 39.471,25.615L38.293,26.793A1,1 0,0 0,39 28.5L44,28.5A1,1 0,0 0,45 27.5L45,22.5A1,1 0,0 0,44.383 21.576A1,1 0,
0 0,43.293 21.793L42.301,22.785C40.315,21.02 37.727,20.001 35,20z"
+ android:strokeLineCap="round"
+ android:strokeLineJoin="round" />
+</vector>
diff --git a/application/resources/src/main/res/drawable/ic_sort_scan.xml b/application/resources/src/main/res/drawable/ic_sort_scan.xml
deleted file mode 100644
index db1d417fd0..0000000000
--- a/application/resources/src/main/res/drawable/ic_sort_scan.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- tools:fillColor="#fff"
- android:fillColor="?attr/colorControlNormal"
- android:pathData="M11.5,3C10.852,3 10.139,3.23 9.635,3.723 9.131,4.215 8.825,4.861 8.551,5.686L4.779,17L4,17c-1.093,0 -2,0.907 -2,2v1c0,0.552 0.448,1 1,1h6.256c0.552,0 1,-0.448 1,-1 0,-0.552 -0.448,-1 -1,-1L6.221,19L10.449,6.316c0.225,-0.676 0.449,-1.03 0.584,-1.162 0.29,-0.412 0.623,-0.384 0.934,0 0.135,0.132 0.359,0.486 0.584,1.162l0.816,2.451c0.174,0.524 0.741,0.808 1.266,0.633 0.523,-0.175 0.807,-0.74 0.633,-1.264L14.449,5.686C14.175,4.861 13.869,4.215 13.365,3.723 12.861,3.23 12.148,3 11.5,3ZM16.998,11C13.973,11.001 11.5,13.475 11.5,16.5c0,3.026 2.474,5.5 5.5,5.5 1.828,0 3.538,-0.916 4.557,-2.434 0.308,-0.459 0.186,-1.081 -0.273,-1.389 -0.459,-0.308 -1.081,-0.186 -1.389,0.273 -0.649,0.966 -1.733,1.546 -2.896,1.549 -1.945,0 -3.5,-1.555 -3.5,-3.5 0,-1.945 1.555,-3.5 3.5,-3.5 0.829,0 1.617,0.292 2.236,0.807l-0.59,0.59c-0.315,0.315 -0.092,0.853 0.354,0.854h2.5c0.276,-0 0.5,-0.224 0.5,-0.5v-2.5c-0,-0.202 -0.122,-0.384 -0.309,-0.461 -0.187,-0.078 -0.402,-0.035 -0.545,0.10
7l-0.496,0.496C19.656,11.511 18.363,11.001 17,11Z"
- android:strokeWidth="1"
- android:strokeLineCap="round"
- android:strokeLineJoin="round" />
-</vector>
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 c352046d02..39a2b30e4a 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
@@ -306,8 +306,8 @@ class DisplaySettingsDialog : VLCBottomSheetDialogFragment() {
Medialibrary.SORT_FILENAME -> setupSortViews(binding, isCurrentSort, R.string.sortby_filename, R.string.sort_alpha_asc, R.string.sort_alpha_desc, R.drawable.ic_sort_filename)
Medialibrary.SORT_ARTIST -> setupSortViews(binding, isCurrentSort, R.string.sortby_artist_name, R.string.sort_alpha_asc, R.string.sort_alpha_desc, R.drawable.ic_sort_artist)
Medialibrary.SORT_DURATION -> setupSortViews(binding, isCurrentSort, R.string.sortby_length, R.string.sortby_length_asc, R.string.sortby_length_desc, R.drawable.ic_sort_length)
- Medialibrary.SORT_INSERTIONDATE -> setupSortViews(binding, isCurrentSort, R.string.sortby_date_insertion, R.string.sort_date_asc, R.string.sort_date_desc, R.drawable.ic_sort_scan)
- Medialibrary.SORT_LASTMODIFICATIONDATE -> setupSortViews(binding, isCurrentSort, R.string.sortby_date_last_modified, R.string.sort_date_asc, R.string.sort_date_desc, R.drawable.ic_sort_scan)
+ Medialibrary.SORT_INSERTIONDATE -> setupSortViews(binding, isCurrentSort, R.string.sortby_date_insertion, R.string.sort_date_asc, R.string.sort_date_desc, R.drawable.ic_medialibrary_date)
+ Medialibrary.SORT_LASTMODIFICATIONDATE -> setupSortViews(binding, isCurrentSort, R.string.sortby_date_last_modified, R.string.sort_date_asc, R.string.sort_date_desc, R.drawable.ic_medialibrary_scan)
Medialibrary.SORT_ALBUM -> setupSortViews(binding, isCurrentSort, R.string.sortby_album_name, R.string.sort_alpha_asc, R.string.sort_alpha_desc, R.drawable.ic_sort_album)
Medialibrary.SORT_RELEASEDATE -> setupSortViews(binding, isCurrentSort, R.string.sortby_date_release, R.string.sort_date_asc, R.string.sort_date_desc, R.drawable.ic_sort_date)
Medialibrary.NbMedia -> setupSortViews(binding, isCurrentSort, R.string.sortby_number, R.string.sortby_number_asc, R.string.sortby_number_desc, R.drawable.ic_sort_number)
More information about the Android
mailing list