Move lockscreen tabs into the toolbar

This commit is contained in:
Jonas Lochmann 2024-10-28 01:00:00 +01:00
parent 11a47c5f30
commit 8e02eb3fb3
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36
2 changed files with 104 additions and 100 deletions

View file

@ -51,6 +51,7 @@ fun ScreenScaffold(
backStack: List<BackStackItem>,
snackbarHostState: SnackbarHostState?,
content: @Composable (PaddingValues) -> Unit,
extraBars: (@Composable () -> Unit)? = null,
executeCommand: (UpdateStateCommand) -> Unit,
showAuthenticationDialog: (() -> Unit)?
) {
@ -58,6 +59,7 @@ fun ScreenScaffold(
Scaffold(
topBar = {
Column {
TopAppBar(
title = {
Column {
@ -121,6 +123,9 @@ fun ScreenScaffold(
modifier = Modifier,
windowInsets = WindowInsets.statusBarsIgnoringVisibility
)
extraBars?.invoke()
}
},
bottomBar = {
val backStackColors = ButtonDefaults.textButtonColors(

View file

@ -147,8 +147,7 @@ class LockActivity : AppCompatActivity(), ActivityViewModelHolder, U2fManager.De
subtitle = subtitle,
backStack = emptyList(),
snackbarHostState = null,
content = { padding ->
Column (Modifier.fillMaxSize().padding(padding)) {
extraBars = {
TabRow(
pager.currentPage,
indicator = { tabPositions ->
@ -190,10 +189,11 @@ class LockActivity : AppCompatActivity(), ActivityViewModelHolder, U2fManager.De
)
}
}
},
content = { padding ->
HorizontalPager(
pager,
Modifier.weight(1.0F, fill = true),
Modifier.fillMaxSize().padding(padding),
pageContent = { index ->
when (index) {
0 -> AndroidFragment<LockReasonFragment>(Modifier.fillMaxSize())
@ -202,7 +202,6 @@ class LockActivity : AppCompatActivity(), ActivityViewModelHolder, U2fManager.De
}
}
)
}
},
executeCommand = {},
showAuthenticationDialog =