check write permissions before starting the deletion
This commit is contained in:
parent
6c9c072dc9
commit
0ade1ec579
3 changed files with 12 additions and 1 deletions
|
@ -196,6 +196,12 @@ public class MainActivity extends SimpleActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (String path : mToBeDeleted) {
|
||||||
|
if (Utils.Companion.isShowingWritePermissions(this, new File(path))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
notifyDeletion(deletedCnt);
|
notifyDeletion(deletedCnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,6 +293,9 @@ public class MediaActivity extends SimpleActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareForDeleting() {
|
private void prepareForDeleting() {
|
||||||
|
if (Utils.Companion.isShowingWritePermissions(this, new File(mPath)))
|
||||||
|
return;
|
||||||
|
|
||||||
Utils.Companion.showToast(this, R.string.deleting);
|
Utils.Companion.showToast(this, R.string.deleting);
|
||||||
final SparseBooleanArray items = mGridView.getCheckedItemPositions();
|
final SparseBooleanArray items = mGridView.getCheckedItemPositions();
|
||||||
final int cnt = items.size();
|
final int cnt = items.size();
|
||||||
|
|
|
@ -242,8 +242,10 @@ public class ViewPagerActivity extends SimpleActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyDeletion() {
|
private void notifyDeletion() {
|
||||||
mToBeDeleted = getCurrentFile().getAbsolutePath();
|
if (Utils.Companion.isShowingWritePermissions(this, new File(mPath)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
mToBeDeleted = getCurrentFile().getAbsolutePath();
|
||||||
if (mMedia.size() <= 1) {
|
if (mMedia.size() <= 1) {
|
||||||
deleteFile();
|
deleteFile();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue