try keeping old Last Modified after rotating when needed

This commit is contained in:
tibbi 2017-11-09 11:27:30 +01:00
parent bec7a4cb62
commit 9141073ed6
2 changed files with 8 additions and 2 deletions

View file

@ -45,7 +45,7 @@ ext {
} }
dependencies { 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.davemorrissey.labs:subsampling-scale-image-view:3.7.2'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'

View file

@ -507,6 +507,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
return@getFileOutputStream return@getFileOutputStream
} }
val oldLastModified = getCurrentFile().lastModified()
if (currPath.isJpg()) { if (currPath.isJpg()) {
saveRotation(getCurrentFile(), tmpFile) saveRotation(getCurrentFile(), tmpFile)
} else { } else {
@ -517,9 +518,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
deleteFile(selectedFile) {} deleteFile(selectedFile) {}
} }
copyFile(tmpFile, selectedFile) copyFile(tmpFile, selectedFile)
scanPath(selectedFile.absolutePath) {} scanFile(selectedFile) {}
toast(R.string.file_saved) toast(R.string.file_saved)
if (config.keepLastModified) {
selectedFile.setLastModified(oldLastModified)
updateLastModified(selectedFile, oldLastModified)
}
it.flush() it.flush()
it.close() it.close()
mRotationDegrees = 0f mRotationDegrees = 0f