Skip to content

Commit 5ed1d74

Browse files
author
Majid Arabi
committed
improved performance,
added license
1 parent 95b8c1c commit 5ed1d74

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2022 Majid Arabi.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

file-picker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ afterEvaluate {
5858
from components.release
5959
groupId = 'com.github.majidarabi'
6060
artifactId = 'file-picker'
61-
version = '0.0.5'
61+
version = '0.0.6'
6262
}
6363
}
6464
}

file-picker/src/main/java/com/github/file_picker/FilePicker.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ class FilePicker : BottomSheetDialogFragment() {
224224
private fun loadFiles() = CoroutineScope(Dispatchers.IO).launch {
225225
val files = getStorageFiles(fileType = fileType)
226226
.map { Media(file = it) }
227-
.sortedByDescending { it.file.lastModified() }
228227

229228
selectedFiles.forEach { media ->
230229
files.forEach {
@@ -342,8 +341,11 @@ class FilePicker : BottomSheetDialogFragment() {
342341
/**
343342
* Show file picker
344343
*
345-
* @param title
346-
* @param submitText
344+
* @param title the bottom sheet dialog title
345+
* @param titleTextColor the bottom sheet dialog title text color
346+
* @param submitText the submit button text
347+
* @param submitTextColor the submit button text color
348+
* @param accentColor the accent color using in submit button background color, progress bar color, selected item color.
347349
* @param fileType
348350
* @param listDirection
349351
* @param cancellable
@@ -388,7 +390,10 @@ fun AppCompatActivity.showFilePicker(
388390
* Show file picker
389391
*
390392
* @param title
393+
* @param titleTextColor
391394
* @param submitText
395+
* @param submitTextColor
396+
* @param accentColor
392397
* @param fileType
393398
* @param listDirection
394399
* @param cancellable

file-picker/src/main/java/com/github/file_picker/extension/ActivityExt.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fun Activity.getStorageFiles(
2626
columns,
2727
null,
2828
null,
29-
null
29+
MediaStore.Images.ImageColumns.DATE_MODIFIED + " DESC"
3030
)
3131
//Total number of images
3232
val count = cursor?.count ?: return arrayListOf()

0 commit comments

Comments
 (0)