mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
apply the pattern protection to temporarily showing hidden folders too
This commit is contained in:
parent
2b518ec4f2
commit
f789ecdf02
3 changed files with 26 additions and 5 deletions
|
@ -97,8 +97,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
R.id.sort -> showSortingDialog()
|
||||
R.id.open_camera -> launchCamera()
|
||||
R.id.show_all -> showAllMedia()
|
||||
R.id.temporarily_show_hidden -> toggleTemporarilyShowHidden(true)
|
||||
R.id.stop_showing_hidden -> toggleTemporarilyShowHidden(false)
|
||||
R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden(true)
|
||||
R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden(false)
|
||||
R.id.increase_column_count -> increaseColumnCount()
|
||||
R.id.reduce_column_count -> reduceColumnCount()
|
||||
R.id.settings -> launchSettings()
|
||||
|
@ -210,6 +210,16 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
finish()
|
||||
}
|
||||
|
||||
private fun tryToggleTemporarilyShowHidden(show: Boolean) {
|
||||
if (config.temporarilyShowHidden) {
|
||||
toggleTemporarilyShowHidden(show)
|
||||
} else {
|
||||
handleHiddenFolderPasswordProtection {
|
||||
toggleTemporarilyShowHidden(show)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun toggleTemporarilyShowHidden(show: Boolean) {
|
||||
config.temporarilyShowHidden = show
|
||||
getDirectories()
|
||||
|
|
|
@ -216,8 +216,8 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
R.id.hide_folder -> tryHideFolder()
|
||||
R.id.unhide_folder -> unhideFolder()
|
||||
R.id.exclude_folder -> tryExcludeFolder()
|
||||
R.id.temporarily_show_hidden -> toggleTemporarilyShowHidden(true)
|
||||
R.id.stop_showing_hidden -> toggleTemporarilyShowHidden(false)
|
||||
R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden(true)
|
||||
R.id.stop_showing_hidden -> tryToggleTemporarilyShowHidden(false)
|
||||
R.id.increase_column_count -> increaseColumnCount()
|
||||
R.id.reduce_column_count -> reduceColumnCount()
|
||||
R.id.settings -> launchSettings()
|
||||
|
@ -316,6 +316,16 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
false
|
||||
}
|
||||
|
||||
private fun tryToggleTemporarilyShowHidden(show: Boolean) {
|
||||
if (config.temporarilyShowHidden) {
|
||||
toggleTemporarilyShowHidden(show)
|
||||
} else {
|
||||
handleHiddenFolderPasswordProtection {
|
||||
toggleTemporarilyShowHidden(show)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun toggleTemporarilyShowHidden(show: Boolean) {
|
||||
config.temporarilyShowHidden = show
|
||||
getMedia()
|
||||
|
|
|
@ -89,7 +89,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
}
|
||||
|
||||
if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) {
|
||||
config.temporarilyShowHidden = true
|
||||
if (!config.isPasswordProtectionOn)
|
||||
config.temporarilyShowHidden = true
|
||||
}
|
||||
|
||||
showSystemUI()
|
||||
|
|
Loading…
Reference in a new issue