properly handle negative callback of handleSAFDialog
This commit is contained in:
parent
e18cce99a8
commit
4bee97ffd6
|
@ -397,6 +397,10 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
|
|||
CompressAsDialog(activity, firstPath) {
|
||||
val destination = it
|
||||
activity.handleSAFDialog(firstPath) {
|
||||
if (!it) {
|
||||
return@handleSAFDialog
|
||||
}
|
||||
|
||||
activity.toast(R.string.compressing)
|
||||
val paths = getSelectedFileDirItems().map { it.path }
|
||||
Thread {
|
||||
|
@ -422,6 +426,10 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
|
|||
}
|
||||
|
||||
activity.handleSAFDialog(firstPath) {
|
||||
if (!it) {
|
||||
return@handleSAFDialog
|
||||
}
|
||||
|
||||
val paths = getSelectedFileDirItems().asSequence().map { it.path }.filter { it.isZipFile() }.toList()
|
||||
tryDecompressingPaths(paths) {
|
||||
if (it) {
|
||||
|
@ -608,6 +616,10 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
|
|||
}
|
||||
|
||||
activity.handleSAFDialog(SAFPath) {
|
||||
if (!it) {
|
||||
return@handleSAFDialog
|
||||
}
|
||||
|
||||
val files = ArrayList<FileDirItem>(selectedKeys.size)
|
||||
val positions = ArrayList<Int>()
|
||||
selectedKeys.forEach {
|
||||
|
|
|
@ -51,6 +51,10 @@ class CreateNewItemDialog(val activity: SimpleActivity, val path: String, val ca
|
|||
private fun createDirectory(path: String, alertDialog: AlertDialog, callback: (Boolean) -> Unit) {
|
||||
when {
|
||||
activity.needsStupidWritePermissions(path) -> activity.handleSAFDialog(path) {
|
||||
if (!it) {
|
||||
return@handleSAFDialog
|
||||
}
|
||||
|
||||
val documentFile = activity.getDocumentFile(path.getParentPath())
|
||||
if (documentFile == null) {
|
||||
val error = String.format(activity.getString(R.string.could_not_create_folder), path)
|
||||
|
@ -83,6 +87,10 @@ class CreateNewItemDialog(val activity: SimpleActivity, val path: String, val ca
|
|||
when {
|
||||
activity.needsStupidWritePermissions(path) -> {
|
||||
activity.handleSAFDialog(path) {
|
||||
if (!it) {
|
||||
return@handleSAFDialog
|
||||
}
|
||||
|
||||
val documentFile = activity.getDocumentFile(path.getParentPath())
|
||||
if (documentFile == null) {
|
||||
val error = String.format(activity.getString(R.string.could_not_create_file), path)
|
||||
|
|
Loading…
Reference in New Issue