delete only media files at deleting a folder
This commit is contained in:
parent
34d015734e
commit
d2546e1a3e
2 changed files with 3 additions and 1 deletions
|
@ -132,6 +132,8 @@ class Utils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun isPhotoVideo(file: File) = file.isPhotoVideo()
|
||||||
|
|
||||||
fun needsStupidWritePermissions(context: Context, path: String) = context.needsStupidWritePermissions(path)
|
fun needsStupidWritePermissions(context: Context, path: String) = context.needsStupidWritePermissions(path)
|
||||||
|
|
||||||
fun getFileDocument(context: Context, path: String, treeUri: String) = context.getFileDocument(path, treeUri)
|
fun getFileDocument(context: Context, path: String, treeUri: String) = context.getFileDocument(path, treeUri)
|
||||||
|
|
|
@ -235,7 +235,7 @@ public class MainActivity extends SimpleActivity
|
||||||
if (dir.exists()) {
|
if (dir.exists()) {
|
||||||
final File[] files = dir.listFiles();
|
final File[] files = dir.listFiles();
|
||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
if (file.isFile()) {
|
if (file.isFile() && Utils.Companion.isPhotoVideo(file)) {
|
||||||
updatedFiles.add(file);
|
updatedFiles.add(file);
|
||||||
deleteItem(file);
|
deleteItem(file);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue