forked from geode-sdk/android-launcher
different method of forcing fullscreen
relates to #3. thanks cvolton for info
This commit is contained in:
1 file changed
+1
-23
@@ -231,18 +231,8 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
|||||||
hideSystemUi()
|
hideSystemUi()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("DEPRECATION")
|
|
||||||
private fun hideSystemUi() {
|
private fun hideSystemUi() {
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
// window compat is dumb!!
|
|
||||||
setLegacyVisibility()
|
|
||||||
window.decorView.setOnSystemUiVisibilityChangeListener { visibility ->
|
|
||||||
if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) {
|
|
||||||
setLegacyVisibility()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WindowCompat.getInsetsController(window, window.decorView).apply {
|
WindowCompat.getInsetsController(window, window.decorView).apply {
|
||||||
systemBarsBehavior =
|
systemBarsBehavior =
|
||||||
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||||
@@ -250,18 +240,6 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("DEPRECATION")
|
|
||||||
private fun setLegacyVisibility() {
|
|
||||||
// setDecorFitsSystemWindows doesn't hide anything
|
|
||||||
window.decorView.systemUiVisibility =
|
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
|
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
|
|
||||||
View.SYSTEM_UI_FLAG_FULLSCREEN or
|
|
||||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
|
|
||||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
unregisterReceivers()
|
unregisterReceivers()
|
||||||
|
|||||||
Reference in new issue
Block a user