mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 09:49:25 +02:00
Move lockscreen tabs into the toolbar
This commit is contained in:
parent
11a47c5f30
commit
8e02eb3fb3
2 changed files with 104 additions and 100 deletions
|
@ -51,6 +51,7 @@ fun ScreenScaffold(
|
||||||
backStack: List<BackStackItem>,
|
backStack: List<BackStackItem>,
|
||||||
snackbarHostState: SnackbarHostState?,
|
snackbarHostState: SnackbarHostState?,
|
||||||
content: @Composable (PaddingValues) -> Unit,
|
content: @Composable (PaddingValues) -> Unit,
|
||||||
|
extraBars: (@Composable () -> Unit)? = null,
|
||||||
executeCommand: (UpdateStateCommand) -> Unit,
|
executeCommand: (UpdateStateCommand) -> Unit,
|
||||||
showAuthenticationDialog: (() -> Unit)?
|
showAuthenticationDialog: (() -> Unit)?
|
||||||
) {
|
) {
|
||||||
|
@ -58,6 +59,7 @@ fun ScreenScaffold(
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = {
|
topBar = {
|
||||||
|
Column {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = {
|
title = {
|
||||||
Column {
|
Column {
|
||||||
|
@ -121,6 +123,9 @@ fun ScreenScaffold(
|
||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
windowInsets = WindowInsets.statusBarsIgnoringVisibility
|
windowInsets = WindowInsets.statusBarsIgnoringVisibility
|
||||||
)
|
)
|
||||||
|
|
||||||
|
extraBars?.invoke()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
bottomBar = {
|
bottomBar = {
|
||||||
val backStackColors = ButtonDefaults.textButtonColors(
|
val backStackColors = ButtonDefaults.textButtonColors(
|
||||||
|
|
|
@ -147,8 +147,7 @@ class LockActivity : AppCompatActivity(), ActivityViewModelHolder, U2fManager.De
|
||||||
subtitle = subtitle,
|
subtitle = subtitle,
|
||||||
backStack = emptyList(),
|
backStack = emptyList(),
|
||||||
snackbarHostState = null,
|
snackbarHostState = null,
|
||||||
content = { padding ->
|
extraBars = {
|
||||||
Column (Modifier.fillMaxSize().padding(padding)) {
|
|
||||||
TabRow(
|
TabRow(
|
||||||
pager.currentPage,
|
pager.currentPage,
|
||||||
indicator = { tabPositions ->
|
indicator = { tabPositions ->
|
||||||
|
@ -190,10 +189,11 @@ class LockActivity : AppCompatActivity(), ActivityViewModelHolder, U2fManager.De
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
content = { padding ->
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
pager,
|
pager,
|
||||||
Modifier.weight(1.0F, fill = true),
|
Modifier.fillMaxSize().padding(padding),
|
||||||
pageContent = { index ->
|
pageContent = { index ->
|
||||||
when (index) {
|
when (index) {
|
||||||
0 -> AndroidFragment<LockReasonFragment>(Modifier.fillMaxSize())
|
0 -> AndroidFragment<LockReasonFragment>(Modifier.fillMaxSize())
|
||||||
|
@ -202,7 +202,6 @@ class LockActivity : AppCompatActivity(), ActivityViewModelHolder, U2fManager.De
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
|
||||||
},
|
},
|
||||||
executeCommand = {},
|
executeCommand = {},
|
||||||
showAuthenticationDialog =
|
showAuthenticationDialog =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue