Remove Accompanist insets
This commit is contained in:
parent
3fec8fc70c
commit
6bff15b643
@ -1,13 +0,0 @@
|
|||||||
package de.mm20.launcher2.ui.component
|
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Spacer
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import com.google.accompanist.insets.navigationBarsHeight
|
|
||||||
import com.google.accompanist.insets.statusBarsHeight
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun NavBarSpacer() = Spacer(modifier = Modifier.navigationBarsHeight())
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun StatusBarSpacer() = Spacer(modifier = Modifier.statusBarsHeight())
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
package de.mm20.launcher2.ui.component.preferences
|
package de.mm20.launcher2.ui.component.preferences
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.RowScope
|
import androidx.compose.foundation.layout.RowScope
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
@ -16,7 +15,6 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.google.accompanist.insets.systemBarsPadding
|
|
||||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||||
import de.mm20.launcher2.ui.locals.LocalNavController
|
import de.mm20.launcher2.ui.locals.LocalNavController
|
||||||
|
|
||||||
@ -35,40 +33,36 @@ fun PreferenceScreen(
|
|||||||
systemUiController.setNavigationBarColor(Color.Black)
|
systemUiController.setNavigationBarColor(Color.Black)
|
||||||
|
|
||||||
val activity = LocalContext.current as? AppCompatActivity
|
val activity = LocalContext.current as? AppCompatActivity
|
||||||
Box(
|
Scaffold(
|
||||||
modifier = Modifier.systemBarsPadding()
|
floatingActionButton = floatingActionButton,
|
||||||
) {
|
topBar = {
|
||||||
Scaffold(
|
CenterAlignedTopAppBar(
|
||||||
floatingActionButton = floatingActionButton,
|
title = {
|
||||||
topBar = {
|
Text(
|
||||||
CenterAlignedTopAppBar(
|
title,
|
||||||
title = {
|
overflow = TextOverflow.Ellipsis,
|
||||||
Text(
|
modifier = Modifier.padding(horizontal = 16.dp),
|
||||||
title,
|
maxLines = 1
|
||||||
overflow = TextOverflow.Ellipsis,
|
)
|
||||||
modifier = Modifier.padding(horizontal = 16.dp),
|
},
|
||||||
maxLines = 1
|
navigationIcon = {
|
||||||
)
|
IconButton(onClick = {
|
||||||
},
|
if (navController?.navigateUp() != true) {
|
||||||
navigationIcon = {
|
activity?.onBackPressed()
|
||||||
IconButton(onClick = {
|
|
||||||
if (navController?.navigateUp() != true) {
|
|
||||||
activity?.onBackPressed()
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
Icon(imageVector = Icons.Rounded.ArrowBack, contentDescription = "Back")
|
|
||||||
}
|
}
|
||||||
},
|
}) {
|
||||||
actions = topBarActions
|
Icon(imageVector = Icons.Rounded.ArrowBack, contentDescription = "Back")
|
||||||
)
|
}
|
||||||
}) {
|
},
|
||||||
LazyColumn(
|
actions = topBarActions
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxSize()
|
|
||||||
.padding(it),
|
|
||||||
content = content,
|
|
||||||
)
|
)
|
||||||
}
|
}) {
|
||||||
|
LazyColumn(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(it),
|
||||||
|
content = content,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user