mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
scan only the affected items on Delete
This commit is contained in:
parent
5e845c694c
commit
09e4f00f27
2 changed files with 6 additions and 3 deletions
|
@ -183,7 +183,8 @@ public class PhotosActivity extends AppCompatActivity
|
||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaScannerConnection.scanFile(this, new String[]{path}, null, null);
|
final String[] deletedPaths = toBeDeleted.toArray(new String[toBeDeleted.size()]);
|
||||||
|
MediaScannerConnection.scanFile(this, deletedPaths, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private View.OnClickListener undoDeletion = new View.OnClickListener() {
|
private View.OnClickListener undoDeletion = new View.OnClickListener() {
|
||||||
|
|
|
@ -102,8 +102,10 @@ public class ViewPagerActivity extends AppCompatActivity
|
||||||
private void deleteImage() {
|
private void deleteImage() {
|
||||||
Helpers.showToast(this, R.string.deleting);
|
Helpers.showToast(this, R.string.deleting);
|
||||||
final File file = getCurrentFile();
|
final File file = getCurrentFile();
|
||||||
file.delete();
|
if (file.delete()) {
|
||||||
MediaScannerConnection.scanFile(this, new String[]{path}, null, this);
|
final String[] deletedPath = new String[]{file.getAbsolutePath()};
|
||||||
|
MediaScannerConnection.scanFile(this, deletedPath, null, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDirEmpty() {
|
private boolean isDirEmpty() {
|
||||||
|
|
Loading…
Reference in a new issue