forked from MeloNX/MeloNX
expand full screen to behind cutouts
This commit is contained in:
parent
ff3099e4a1
commit
ffaa4d8ac1
@ -68,10 +68,7 @@ class MainActivity : ComponentActivity() {
|
||||
|
||||
fun setFullScreen() :Unit {
|
||||
requestedOrientation =
|
||||
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
||||
|
||||
WindowCompat.setDecorFitsSystemWindows(window,false)
|
||||
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
|
||||
|
||||
var insets = WindowCompat.getInsetsController(window, window.decorView)
|
||||
|
||||
@ -130,6 +127,9 @@ class MainActivity : ComponentActivity() {
|
||||
|
||||
initialize()
|
||||
|
||||
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
||||
WindowCompat.setDecorFitsSystemWindows(window,false)
|
||||
|
||||
if(if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
!Environment.isExternalStorageManager()
|
||||
} else {
|
||||
|
@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.safeContentPadding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.wrapContentHeight
|
||||
import androidx.compose.foundation.layout.wrapContentWidth
|
||||
@ -172,7 +173,8 @@ class HomeViews {
|
||||
var showBottomSheet = remember { mutableStateOf(false) }
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
modifier = Modifier.fillMaxSize()
|
||||
.safeContentPadding(),
|
||||
topBar = {
|
||||
navController?.apply {
|
||||
MainTopBar(navController)
|
||||
|
@ -11,6 +11,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
@ -38,8 +39,11 @@ class MainView {
|
||||
|
||||
@Composable
|
||||
fun GameView(mainViewModel: MainViewModel){
|
||||
Box {
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
var controller = GameController(mainViewModel.activity)
|
||||
Surface(color = Color.Green, modifier = Modifier.fillMaxSize()) {
|
||||
|
||||
}
|
||||
AndroidView(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
factory = { context ->
|
||||
|
@ -21,6 +21,7 @@ import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.safeContentPadding
|
||||
import androidx.compose.foundation.layout.wrapContentHeight
|
||||
import androidx.compose.foundation.layout.wrapContentWidth
|
||||
import androidx.compose.material.icons.Icons
|
||||
@ -108,7 +109,8 @@ class SettingViews {
|
||||
)
|
||||
loaded.value = true
|
||||
}
|
||||
Scaffold(modifier = Modifier.fillMaxSize(),
|
||||
Scaffold(modifier = Modifier.fillMaxSize()
|
||||
.safeContentPadding(),
|
||||
topBar = {
|
||||
TopAppBar(title = {
|
||||
Text(text = "Settings")
|
||||
|
Loading…
x
Reference in New Issue
Block a user