From 4b8a457fa927bc3eac9bce61b4cf732b042de0c7 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Sun, 4 Apr 2021 18:18:04 +0800 Subject: [PATCH] change QUERY_ARG_SORT_DIRECTION value from array to int in Android --- .../morbit/photogallery/PhotoGalleryPlugin.kt | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt b/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt index 9fd6f02..9717566 100644 --- a/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt +++ b/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt @@ -302,12 +302,9 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler { MediaStore.Images.Media.DATE_MODIFIED ) ) - putIntArray( + putInt( android.content.ContentResolver.QUERY_ARG_SORT_DIRECTION, - intArrayOf( - android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING, - android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING - ) + android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING ) // Selection if (albumId != allAlbumId) { @@ -365,12 +362,9 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler { MediaStore.Video.Media.DATE_MODIFIED ) ) - putIntArray( + putInt( android.content.ContentResolver.QUERY_ARG_SORT_DIRECTION, - intArrayOf( - android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING, - android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING - ) + android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING ) // Selection if (albumId != allAlbumId) { @@ -574,12 +568,9 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler { MediaStore.Images.Media.DATE_MODIFIED ) ) - putIntArray( + putInt( android.content.ContentResolver.QUERY_ARG_SORT_DIRECTION, - intArrayOf( - android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING, - android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING - ) + android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING ) // Selection if (albumId != allAlbumId) { @@ -630,12 +621,9 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler { MediaStore.Video.Media.DATE_MODIFIED ) ) - putIntArray( + putInt( android.content.ContentResolver.QUERY_ARG_SORT_DIRECTION, - intArrayOf( - android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING, - android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING - ) + android.content.ContentResolver.QUERY_SORT_DIRECTION_DESCENDING ) // Selection if (albumId != allAlbumId) {