diff --git a/app/build.gradle b/app/build.gradle index e1924b3e5..42f9024db 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,7 +45,7 @@ ext { } dependencies { - compile 'com.simplemobiletools:commons:2.37.10' + compile 'com.simplemobiletools:commons:2.37.12' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.7.2' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index b7f0cdf4d..2a8099959 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -507,6 +507,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return@getFileOutputStream } + val oldLastModified = getCurrentFile().lastModified() if (currPath.isJpg()) { saveRotation(getCurrentFile(), tmpFile) } else { @@ -517,9 +518,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View deleteFile(selectedFile) {} } copyFile(tmpFile, selectedFile) - scanPath(selectedFile.absolutePath) {} + scanFile(selectedFile) {} toast(R.string.file_saved) + if (config.keepLastModified) { + selectedFile.setLastModified(oldLastModified) + updateLastModified(selectedFile, oldLastModified) + } + it.flush() it.close() mRotationDegrees = 0f