From f322eb31a00ee22a78e5a803672cfd5dca3c9988 Mon Sep 17 00:00:00 2001 From: Dane Evans Date: Sat, 6 Dec 2025 23:29:38 +1100 Subject: [PATCH] Fix/3894 talkback confusion (#3914) --- app/src/main/java/com/geeksville/mesh/ui/Main.kt | 16 +++++++++++++--- .../connections/components/ConnectionsNavIcon.kt | 9 +++++++-- .../com/geeksville/mesh/ui/contact/Contacts.kt | 3 ++- .../composeResources/values/strings.xml | 2 +- .../meshtastic/core/ui/component/MainAppBar.kt | 12 ++++-------- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/Main.kt b/app/src/main/java/com/geeksville/mesh/ui/Main.kt index 41f502336..fd22b1da5 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/Main.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/Main.kt @@ -32,9 +32,11 @@ import androidx.compose.animation.scaleOut import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.recalculateWindowInsets import androidx.compose.foundation.layout.safeDrawingPadding +import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons @@ -71,6 +73,7 @@ import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.unit.dp import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavDestination @@ -381,9 +384,16 @@ fun MainScreen(uIViewModel: UIViewModel = hiltViewModel(), scanModel: BTScanMode }, selected = isSelected, label = { - if (navSuiteType != NavigationSuiteType.ShortNavigationBarCompact) { - Text(stringResource(destination.label)) - } + Text( + text = stringResource(destination.label), + modifier = + if (navSuiteType == NavigationSuiteType.ShortNavigationBarCompact) { + Modifier.width(1.dp) + .height(1.dp) // hide on phone - min 1x1 or talkback won't see it. + } else { + Modifier + }, + ) }, onClick = { val isRepress = destination == topLevelDestination diff --git a/app/src/main/java/com/geeksville/mesh/ui/connections/components/ConnectionsNavIcon.kt b/app/src/main/java/com/geeksville/mesh/ui/connections/components/ConnectionsNavIcon.kt index 6e51ae673..895663f5c 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/connections/components/ConnectionsNavIcon.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/connections/components/ConnectionsNavIcon.kt @@ -49,7 +49,12 @@ import org.meshtastic.core.ui.theme.StatusColors.StatusRed import org.meshtastic.core.ui.theme.StatusColors.StatusYellow @Composable -fun ConnectionsNavIcon(modifier: Modifier = Modifier, connectionState: ConnectionState, deviceType: DeviceType?) { +fun ConnectionsNavIcon( + modifier: Modifier = Modifier, + connectionState: ConnectionState, + deviceType: DeviceType?, + contentDescription: String? = null, +) { val tint = getTint(connectionState) val (backgroundIcon, connectionTypeIcon) = getIconPair(deviceType = deviceType, connectionState = connectionState) @@ -58,7 +63,7 @@ fun ConnectionsNavIcon(modifier: Modifier = Modifier, connectionState: Connectio Icon( imageVector = backgroundIcon, - contentDescription = null, + contentDescription = contentDescription, tint = tint, modifier = modifier.drawWithContent { diff --git a/app/src/main/java/com/geeksville/mesh/ui/contact/Contacts.kt b/app/src/main/java/com/geeksville/mesh/ui/contact/Contacts.kt index fef161c45..3c0c60a60 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/contact/Contacts.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/contact/Contacts.kt @@ -95,6 +95,7 @@ import org.meshtastic.core.strings.mute_status_muted_for_hours import org.meshtastic.core.strings.mute_status_unmuted import org.meshtastic.core.strings.okay import org.meshtastic.core.strings.select_all +import org.meshtastic.core.strings.share_contact import org.meshtastic.core.strings.unmute import org.meshtastic.core.ui.component.MainAppBar import org.meshtastic.core.ui.component.ScrollToTopEvent @@ -227,7 +228,7 @@ fun ContactsScreen( ), onClick = onNavigateToShare, ) { - Icon(Icons.Rounded.QrCode2, contentDescription = null) + Icon(Icons.Rounded.QrCode2, contentDescription = stringResource(Res.string.share_contact)) } }, ) { paddingValues -> diff --git a/core/strings/src/commonMain/composeResources/values/strings.xml b/core/strings/src/commonMain/composeResources/values/strings.xml index 03d63617a..2149c0687 100644 --- a/core/strings/src/commonMain/composeResources/values/strings.xml +++ b/core/strings/src/commonMain/composeResources/values/strings.xml @@ -179,7 +179,6 @@ Channel Name QR code - application icon Unknown Username Send You haven't yet paired a Meshtastic compatible radio with this phone. Please pair a device and set your username.\n\nThis open-source application is in development, if you find problems please post on our forum: https://github.com/orgs/meshtastic/discussions.\n\nFor more information see our web page - www.meshtastic.org. @@ -753,6 +752,7 @@ Conversations Nodes Settings + Selected Set your region Reply Your node will periodically send an unencrypted map report packet to the configured MQTT server, this includes id, long and short name, approximate location, hardware model, role, firmware version, LoRa region, modem preset and primary channel name. diff --git a/core/ui/src/main/kotlin/org/meshtastic/core/ui/component/MainAppBar.kt b/core/ui/src/main/kotlin/org/meshtastic/core/ui/component/MainAppBar.kt index 75fe99393..741ad0fa3 100644 --- a/core/ui/src/main/kotlin/org/meshtastic/core/ui/component/MainAppBar.kt +++ b/core/ui/src/main/kotlin/org/meshtastic/core/ui/component/MainAppBar.kt @@ -42,7 +42,6 @@ import org.jetbrains.compose.resources.stringResource import org.meshtastic.core.database.model.Node import org.meshtastic.core.strings.R import org.meshtastic.core.strings.Res -import org.meshtastic.core.strings.application_icon import org.meshtastic.core.strings.navigate_back import org.meshtastic.core.ui.component.preview.BooleanProvider import org.meshtastic.core.ui.component.preview.previewNode @@ -84,13 +83,10 @@ fun MainAppBar( } } else { { - IconButton(enabled = false, onClick = {}) { - Icon( - imageVector = - ImageVector.vectorResource(id = org.meshtastic.core.ui.R.drawable.ic_meshtastic), - contentDescription = stringResource(Res.string.application_icon), - ) - } + Icon( + imageVector = ImageVector.vectorResource(id = org.meshtastic.core.ui.R.drawable.ic_meshtastic), + contentDescription = null, + ) } }, actions = {