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

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