mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-01-27 08:51:18 +01:00
adding a couple changes related to handling GET_CONTENT intent with multiple files
This commit is contained in:
parent
27aafbab6e
commit
e9afd1c41b
@ -42,7 +42,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:5.0.18'
|
||||
implementation 'com.simplemobiletools:commons:5.2.1'
|
||||
|
||||
implementation files('../libs/RootTools.jar')
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
fun pickedPaths(paths: ArrayList<String>) {
|
||||
val newPaths = paths.map { getFilePublicUri(File(it), BuildConfig.APPLICATION_ID).toString() } as ArrayList
|
||||
val clipData = ClipData("Attachment", arrayOf(newPaths.getMimeType()), ClipData.Item(newPaths.removeAt(0)))
|
||||
val clipData = ClipData("Attachment", arrayOf(paths.getMimeType()), ClipData.Item(newPaths.removeAt(0)))
|
||||
|
||||
newPaths.forEach {
|
||||
clipData.addItem(ClipData.Item(it))
|
||||
|
@ -143,8 +143,12 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
|
||||
|
||||
private fun confirmSelection() {
|
||||
if (selectedKeys.isNotEmpty()) {
|
||||
val paths = getSelectedFileDirItems().filter { !it.isDirectory }.map { it.path } as ArrayList<String>
|
||||
listener?.selectedPaths(paths)
|
||||
val paths = getSelectedFileDirItems().asSequence().filter { !it.isDirectory }.map { it.path }.toMutableList() as ArrayList<String>
|
||||
if (paths.isEmpty()) {
|
||||
finishActMode()
|
||||
} else {
|
||||
listener?.selectedPaths(paths)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user