mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-26 23:58:43 +07:00
Returning old function, because LibGDX function is a one-way set
See 0ddf67530f
This commit is contained in:
@ -4,6 +4,7 @@ import android.content.pm.ActivityInfo
|
||||
import android.os.Build
|
||||
import android.view.Display
|
||||
import android.view.Display.Mode
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication
|
||||
@ -59,7 +60,22 @@ class AndroidDisplay(private val activity: AndroidApplication) : PlatformDisplay
|
||||
|
||||
override fun hasSystemUiVisibility() = true
|
||||
|
||||
override fun setSystemUiVisibility(hide: Boolean) = activity.runOnUiThread { activity.useImmersiveMode(hide) }
|
||||
override fun setSystemUiVisibility(hide: Boolean) {
|
||||
activity.runOnUiThread {
|
||||
setSystemUiVisibilityFromUiThread(hide)
|
||||
}
|
||||
}
|
||||
internal fun setSystemUiVisibilityFromUiThread(hide: Boolean) {
|
||||
@Suppress("DEPRECATION") // Avoids @RequiresApi(Build.VERSION_CODES.R)
|
||||
activity.window.decorView.systemUiVisibility =
|
||||
if (hide)
|
||||
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_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_FULLSCREEN or
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
else
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
}
|
||||
|
||||
override fun hasCutout(): Boolean {
|
||||
return when {
|
||||
|
Reference in New Issue
Block a user