diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/compose/TrustedNetworksScreen.kt b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/compose/TrustedNetworksScreen.kt
index 117701eca..24c69da54 100644
--- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/compose/TrustedNetworksScreen.kt
+++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/compose/TrustedNetworksScreen.kt
@@ -62,6 +62,10 @@ import androidx.core.content.ContextCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.compose.LocalLifecycleOwner
+import androidx.compose.material3.Button
+import androidx.compose.ui.semantics.heading
+import androidx.compose.ui.semantics.semantics
+import androidx.compose.foundation.layout.Arrangement
import org.strongswan.android.R
import org.strongswan.android.ui.compose.components.ShxSection
import org.strongswan.android.ui.compose.components.ShxSectionDivider
@@ -170,10 +174,8 @@ fun TrustedNetworksScreen(
subtitle = stringResource(R.string.auto_connect_summary),
checked = enabled,
onCheckedChange = { checked ->
- if (checked)
- {
- requestSsidPermissions()
- }
+ /* the permission is requested from the explainer card below, not
+ * straight from the toggle */
update { it.copy(enabled = checked) }
},
)
@@ -193,27 +195,39 @@ fun TrustedNetworksScreen(
Spacer(Modifier.size(ShxSpacing.md))
Surface(
shape = MaterialTheme.shapes.large,
- color = MaterialTheme.colorScheme.errorContainer,
+ color = MaterialTheme.colorScheme.primaryContainer,
+ contentColor = MaterialTheme.colorScheme.onPrimaryContainer,
modifier = Modifier
.fillMaxWidth()
- .padding(horizontal = ShxSpacing.lg)
- .clickable { requestSsidPermissions() },
+ .padding(horizontal = ShxSpacing.lg),
)
{
- Row(
- verticalAlignment = Alignment.CenterVertically,
- modifier = Modifier.padding(horizontal = ShxSpacing.lg, vertical = ShxSpacing.md),
+ Column(
+ modifier = Modifier.padding(ShxSpacing.lg),
+ verticalArrangement = Arrangement.spacedBy(ShxSpacing.sm),
)
{
+ Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(ShxSpacing.md))
+ {
+ Icon(Icons.Rounded.Wifi, contentDescription = null)
+ Text(
+ text = stringResource(R.string.auto_connect_location_title),
+ style = MaterialTheme.typography.titleSmall,
+ modifier = Modifier.semantics { heading() },
+ )
+ }
+ Text(
+ text = stringResource(R.string.auto_connect_location_why),
+ style = MaterialTheme.typography.bodyMedium,
+ )
Text(
text = stringResource(R.string.auto_connect_location_banner),
style = MaterialTheme.typography.bodySmall,
- color = MaterialTheme.colorScheme.onErrorContainer,
- modifier = Modifier.weight(1f),
)
- TextButton(onClick = { requestSsidPermissions() }) {
- Text(stringResource(R.string.auto_connect_location_grant))
- }
+ Button(
+ onClick = { requestSsidPermissions() },
+ modifier = Modifier.align(Alignment.End),
+ ) { Text(stringResource(R.string.auto_connect_location_grant)) }
}
}
}
diff --git a/src/frontends/android/app/src/main/res/values-de/strings.xml b/src/frontends/android/app/src/main/res/values-de/strings.xml
index ee3914794..c0c04b691 100644
--- a/src/frontends/android/app/src/main/res/values-de/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-de/strings.xml
@@ -510,4 +510,6 @@
Warnungen
Fehler
Systemapps anzeigen
+ Standortzugriff erforderlich
+ Android gibt den WLAN-Namen nur an Apps mit Standortzugriff weiter. Er dient ausschließlich dem Erkennen Ihrer vertrauenswürdigen Netzwerke; der Standort selbst wird nie gelesen oder gesendet.
diff --git a/src/frontends/android/app/src/main/res/values-ru/strings.xml b/src/frontends/android/app/src/main/res/values-ru/strings.xml
index f69179dcb..89bfcfe24 100644
--- a/src/frontends/android/app/src/main/res/values-ru/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-ru/strings.xml
@@ -507,4 +507,6 @@
Предупреждения
Ошибки
Показывать системные приложения
+ Нужен доступ к геолокации
+ Android сообщает имя Wi-Fi сети только приложениям с доступом к геолокации. Оно нужно лишь для распознавания доверенных сетей; сама геолокация не читается и не передаётся.
diff --git a/src/frontends/android/app/src/main/res/values/strings.xml b/src/frontends/android/app/src/main/res/values/strings.xml
index 3af02c5cb..27672dc3d 100644
--- a/src/frontends/android/app/src/main/res/values/strings.xml
+++ b/src/frontends/android/app/src/main/res/values/strings.xml
@@ -512,4 +512,6 @@
Warnings
Errors
Show system apps
+ Location access needed
+ Android only reveals the Wi-Fi network name to apps with location access. The app uses it solely to recognize your trusted networks; the location itself is never read or sent.