mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
fix #901, make sure "Temporarily show hidden" persists through device rotation
This commit is contained in:
parent
0ced7023f1
commit
bd084a09b4
2 changed files with 11 additions and 8 deletions
|
@ -85,8 +85,12 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
mMediumDao = galleryDB.MediumDao()
|
mMediumDao = galleryDB.MediumDao()
|
||||||
mDirectoryDao = galleryDB.DirectoryDao()
|
mDirectoryDao = galleryDB.DirectoryDao()
|
||||||
|
|
||||||
|
if (savedInstanceState == null) {
|
||||||
config.temporarilyShowHidden = false
|
config.temporarilyShowHidden = false
|
||||||
config.tempSkipDeleteConfirmation = false
|
config.tempSkipDeleteConfirmation = false
|
||||||
|
removeTempFolder()
|
||||||
|
}
|
||||||
|
|
||||||
mIsPickImageIntent = isPickImageIntent(intent)
|
mIsPickImageIntent = isPickImageIntent(intent)
|
||||||
mIsPickVideoIntent = isPickVideoIntent(intent)
|
mIsPickVideoIntent = isPickVideoIntent(intent)
|
||||||
mIsGetImageContentIntent = isGetImageContentIntent(intent)
|
mIsGetImageContentIntent = isGetImageContentIntent(intent)
|
||||||
|
@ -97,7 +101,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent ||
|
mIsThirdPartyIntent = mIsPickImageIntent || mIsPickVideoIntent || mIsGetImageContentIntent || mIsGetVideoContentIntent ||
|
||||||
mIsGetAnyContentIntent || mIsSetWallpaperIntent
|
mIsGetAnyContentIntent || mIsSetWallpaperIntent
|
||||||
|
|
||||||
removeTempFolder()
|
|
||||||
directories_refresh_layout.setOnRefreshListener { getDirectories() }
|
directories_refresh_layout.setOnRefreshListener { getDirectories() }
|
||||||
storeStateVariables()
|
storeStateVariables()
|
||||||
checkWhatsNewDialog()
|
checkWhatsNewDialog()
|
||||||
|
@ -216,11 +219,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
|
if (!isChangingConfigurations) {
|
||||||
config.temporarilyShowHidden = false
|
config.temporarilyShowHidden = false
|
||||||
config.tempSkipDeleteConfirmation = false
|
config.tempSkipDeleteConfirmation = false
|
||||||
mTempShowHiddenHandler.removeCallbacksAndMessages(null)
|
mTempShowHiddenHandler.removeCallbacksAndMessages(null)
|
||||||
removeTempFolder()
|
removeTempFolder()
|
||||||
if (!isChangingConfigurations) {
|
|
||||||
GalleryDatabase.destroyInstance()
|
GalleryDatabase.destroyInstance()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
if (config.showAll) {
|
if (config.showAll && !isChangingConfigurations) {
|
||||||
config.temporarilyShowHidden = false
|
config.temporarilyShowHidden = false
|
||||||
config.tempSkipDeleteConfirmation = false
|
config.tempSkipDeleteConfirmation = false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue