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 {
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'

View File

@ -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