@ -129,9 +129,13 @@ fun MainView(
val disableToggle by MDMSettings . forceEnabled . flow . collectAsState ( initial = true )
val disableToggle by MDMSettings . forceEnabled . flow . collectAsState ( initial = true )
val showKeyExpiry by viewModel . showExpiry . collectAsState ( initial = false )
val showKeyExpiry by viewModel . showExpiry . collectAsState ( initial = false )
// Hide the header only on Android TV when the user needs to login
val hideHeader = ( isAndroidTV ( ) && state == Ipn . State . NeedsLogin )
ListItem (
ListItem (
colors = MaterialTheme . colorScheme . surfaceContainerListItem ,
colors = MaterialTheme . colorScheme . surfaceContainerListItem ,
leadingContent = {
leadingContent = {
if ( ! hideHeader ) {
TintedSwitch (
TintedSwitch (
onCheckedChange = {
onCheckedChange = {
if ( ! disableToggle ) {
if ( ! disableToggle ) {
@ -140,6 +144,7 @@ fun MainView(
} ,
} ,
enabled = ! disableToggle ,
enabled = ! disableToggle ,
checked = isOn )
checked = isOn )
}
} ,
} ,
headlineContent = {
headlineContent = {
user ?. NetworkProfile ?. DomainName ?. let { domain ->
user ?. NetworkProfile ?. DomainName ?. let { domain ->
@ -151,7 +156,9 @@ fun MainView(
}
}
} ,
} ,
supportingContent = {
supportingContent = {
if ( ! hideHeader ) {
Text ( text = stateStr , style = MaterialTheme . typography . bodyMedium . short )
Text ( text = stateStr , style = MaterialTheme . typography . bodyMedium . short )
}
} ,
} ,
trailingContent = {
trailingContent = {
Box ( modifier = Modifier . weight ( 1f ) , contentAlignment = Alignment . CenterEnd ) {
Box ( modifier = Modifier . weight ( 1f ) , contentAlignment = Alignment . CenterEnd ) {