Security mode toggle added

This commit is contained in:
tom5079
2019-05-13 21:45:18 +09:00
parent 48c190b449
commit fe523da6ed
8 changed files with 54 additions and 8 deletions

View File

@@ -56,6 +56,18 @@ class GalleryActivity : AppCompatActivity() {
loadImages()
}
override fun onResume() {
val preferences = android.preference.PreferenceManager.getDefaultSharedPreferences(this)
if (preferences.getBoolean("security_mode", false))
window.setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE)
else
window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
super.onResume()
}
override fun onDestroy() {
super.onDestroy()
loadJob?.cancel()