fix #901, make sure "Temporarily show hidden" persists through device rotation

This commit is contained in:
tibbi 2018-08-14 10:12:51 +02:00
parent 0ced7023f1
commit bd084a09b4
2 changed files with 11 additions and 8 deletions

View File

@ -85,8 +85,12 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
mMediumDao = galleryDB.MediumDao()
mDirectoryDao = galleryDB.DirectoryDao()
config.temporarilyShowHidden = false
config.tempSkipDeleteConfirmation = false
if (savedInstanceState == null) {
config.temporarilyShowHidden = false
config.tempSkipDeleteConfirmation = false
removeTempFolder()
}
mIsPickImageIntent = isPickImageIntent(intent)
mIsPickVideoIntent = isPickVideoIntent(intent)
mIsGetImageContentIntent = isGetImageContentIntent(intent)
@ -97,7 +101,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent ||
mIsGetAnyContentIntent || mIsSetWallpaperIntent
removeTempFolder()
directories_refresh_layout.setOnRefreshListener { getDirectories() }
storeStateVariables()
checkWhatsNewDialog()
@ -216,11 +219,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
override fun onDestroy() {
super.onDestroy()
config.temporarilyShowHidden = false
config.tempSkipDeleteConfirmation = false
mTempShowHiddenHandler.removeCallbacksAndMessages(null)
removeTempFolder()
if (!isChangingConfigurations) {
config.temporarilyShowHidden = false
config.tempSkipDeleteConfirmation = false
mTempShowHiddenHandler.removeCallbacksAndMessages(null)
removeTempFolder()
GalleryDatabase.destroyInstance()
}
}

View File

@ -188,7 +188,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
override fun onDestroy() {
super.onDestroy()
if (config.showAll) {
if (config.showAll && !isChangingConfigurations) {
config.temporarilyShowHidden = false
config.tempSkipDeleteConfirmation = false
}