allow deleting only photo and video files with the gallery

This commit is contained in:
tibbi 2016-11-19 22:06:02 +01:00
parent 93e37ec8e6
commit dd47759014
2 changed files with 2 additions and 2 deletions

View file

@ -184,7 +184,7 @@ class MainActivity : SimpleActivity(), GetDirectoriesAsynctask.GetDirectoriesLis
for (delPath in mToBeDeleted) {
val dir = File(delPath)
if (dir.exists()) {
val files = dir.listFiles()
val files = dir.listFiles().filter(File::isPhotoVideo)
files.forEach {
if (it.isFile && it.isPhotoVideo()) {
updatedFiles.add(it)

View file

@ -230,7 +230,7 @@ class MediaActivity : SimpleActivity(), View.OnTouchListener, MediaAdapter.Media
for (delPath in mToBeDeleted) {
val file = File(delPath)
if (file.exists()) {
if (file.exists() && file.isPhotoVideo()) {
if (needsStupidWritePermissions(delPath)) {
if (isShowingPermDialog(file))
return