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) {
|
for (delPath in mToBeDeleted) {
|
||||||
val dir = File(delPath)
|
val dir = File(delPath)
|
||||||
if (dir.exists()) {
|
if (dir.exists()) {
|
||||||
val files = dir.listFiles()
|
val files = dir.listFiles().filter(File::isPhotoVideo)
|
||||||
files.forEach {
|
files.forEach {
|
||||||
if (it.isFile && it.isPhotoVideo()) {
|
if (it.isFile && it.isPhotoVideo()) {
|
||||||
updatedFiles.add(it)
|
updatedFiles.add(it)
|
||||||
|
|
|
@ -230,7 +230,7 @@ class MediaActivity : SimpleActivity(), View.OnTouchListener, MediaAdapter.Media
|
||||||
|
|
||||||
for (delPath in mToBeDeleted) {
|
for (delPath in mToBeDeleted) {
|
||||||
val file = File(delPath)
|
val file = File(delPath)
|
||||||
if (file.exists()) {
|
if (file.exists() && file.isPhotoVideo()) {
|
||||||
if (needsStupidWritePermissions(delPath)) {
|
if (needsStupidWritePermissions(delPath)) {
|
||||||
if (isShowingPermDialog(file))
|
if (isShowingPermDialog(file))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue