mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
Enable secure screen when incognito mode is enabled (#5339)
* Enable secure screen when incognito mode is enabled * Fix incognito banner not showing up after configuration changes
This commit is contained in:
@@ -5,6 +5,7 @@ import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.view.View
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import eu.kanade.tachiyomi.util.system.InternalResourceHelper
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
|
||||
@@ -42,3 +43,11 @@ fun Window.setNavigationBarTransparentCompat(context: Context) {
|
||||
context.getResourceColor(android.R.attr.navigationBarColor, 0.7F)
|
||||
}
|
||||
}
|
||||
|
||||
fun Window.setSecureScreen(enabled: Boolean) {
|
||||
if (enabled) {
|
||||
setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
|
||||
} else {
|
||||
clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user