allow deleting only photo and video files with the gallery
This commit is contained in:
parent
93e37ec8e6
commit
dd47759014
2 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue