parent
79e5c0928b
commit
5cd666d949
|
@ -66,6 +66,12 @@ class CreateNewItemDialog(val activity: SimpleActivity, val path: String, val ca
|
||||||
callback(false)
|
callback(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (activity.isPathOnOTG(path)) {
|
||||||
|
val parent = activity.getDocumentFile(path.getParentPath())
|
||||||
|
val created = parent?.createDirectory(path.getFilenameFromPath())
|
||||||
|
if (created != null) {
|
||||||
|
success(alertDialog)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (File(path).mkdirs()) {
|
if (File(path).mkdirs()) {
|
||||||
success(alertDialog)
|
success(alertDialog)
|
||||||
|
@ -137,10 +143,19 @@ class CreateNewItemDialog(val activity: SimpleActivity, val path: String, val ca
|
||||||
}
|
}
|
||||||
|
|
||||||
isRPlus() || path.startsWith(activity.internalStoragePath, true) -> {
|
isRPlus() || path.startsWith(activity.internalStoragePath, true) -> {
|
||||||
|
|
||||||
|
if (activity.isPathOnOTG(path)) {
|
||||||
|
val parent = activity.getDocumentFile(path.getParentPath())
|
||||||
|
val created = parent?.createFile(path.getMimeType(), path.getFilenameFromPath())
|
||||||
|
if (created != null) {
|
||||||
|
success(alertDialog)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (File(path).createNewFile()) {
|
if (File(path).createNewFile()) {
|
||||||
success(alertDialog)
|
success(alertDialog)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
RootHelpers(activity).createFileFolder(path, true) {
|
RootHelpers(activity).createFileFolder(path, true) {
|
||||||
if (it) {
|
if (it) {
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.simplemobiletools.filemanager.pro.extensions
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.res.Configuration
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
|
Loading…
Reference in New Issue