diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDataManagementMatomoScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDataManagementMatomoScreen.kt index af4f6d51e..8ae113590 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDataManagementMatomoScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDataManagementMatomoScreen.kt @@ -18,13 +18,17 @@ package com.infomaniak.swisstransfer.ui.screen.main.settings import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.* import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Surface +import androidx.compose.material3.Switch import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -39,10 +43,11 @@ import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable -fun SettingsDataManagementMatomoScreen( - navigateBack: (() -> Unit)?, - // onItemClick: (SettingsOptionScreens) -> Unit, -) { +fun SettingsDataManagementMatomoScreen(navigateBack: (() -> Unit)?) { + + // TODO: Use real value from Realm, and save it to Realm / anywhere else too. + var isMatomoAuthorized by rememberSaveable { mutableStateOf(true) } + SmallWindowTopAppBarScaffold( smallWindowTopAppBar = { SwissTransferTopAppBar( @@ -66,6 +71,23 @@ fun SettingsDataManagementMatomoScreen( color = SwissTransferTheme.colors.primaryTextColor, modifier = Modifier.padding(Margin.Medium), ) + Row( + modifier = Modifier + .fillMaxWidth() + .padding(Margin.Medium), + verticalAlignment = Alignment.CenterVertically, + ) { + Text( + text = stringResource(R.string.settingsAuthorizeTracking), + style = SwissTransferTheme.typography.bodyRegular, + color = SwissTransferTheme.colors.primaryTextColor, + ) + Spacer(Modifier.weight(1.0f)) + Switch( + checked = isMatomoAuthorized, + onCheckedChange = { isMatomoAuthorized = it }, + ) + } } } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDataManagementSentryScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDataManagementSentryScreen.kt index 8a1629215..469d295be 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDataManagementSentryScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/settings/SettingsDataManagementSentryScreen.kt @@ -18,13 +18,17 @@ package com.infomaniak.swisstransfer.ui.screen.main.settings import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.* import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Surface +import androidx.compose.material3.Switch import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -39,10 +43,11 @@ import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @Composable -fun SettingsDataManagementSentryScreen( - navigateBack: (() -> Unit)?, - // onItemClick: (SettingsOptionScreens) -> Unit, -) { +fun SettingsDataManagementSentryScreen(navigateBack: (() -> Unit)?) { + + // TODO: Use real value from Realm, and save it to Realm / anywhere else too. + var isSentryAuthorized by rememberSaveable { mutableStateOf(true) } + SmallWindowTopAppBarScaffold( smallWindowTopAppBar = { SwissTransferTopAppBar( @@ -66,6 +71,23 @@ fun SettingsDataManagementSentryScreen( color = SwissTransferTheme.colors.primaryTextColor, modifier = Modifier.padding(Margin.Medium), ) + Row( + modifier = Modifier + .fillMaxWidth() + .padding(Margin.Medium), + verticalAlignment = Alignment.CenterVertically, + ) { + Text( + text = stringResource(R.string.settingsAuthorizeTracking), + style = SwissTransferTheme.typography.bodyRegular, + color = SwissTransferTheme.colors.primaryTextColor, + ) + Spacer(Modifier.weight(1.0f)) + Switch( + checked = isSentryAuthorized, + onCheckedChange = { isSentryAuthorized = it }, + ) + } } } } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index bd67a963e..f1930be17 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -30,6 +30,7 @@ Empfangen Unsere Geschichte beginnt hier Gesendet + Verfolgung genehmigen Über Daten & Datenschutz Standardeinstellungen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 2441010f2..7f1e842ed 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -30,6 +30,7 @@ Recibido Nuestra historia comienza aquí Enviado a + Autorizar el seguimiento Quiénes somos Datos y privacidad Ajustes por defecto diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index deec91269..d4ab83e5e 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -30,6 +30,7 @@ Reçu Notre histoire commence ici Envoyé + Autoriser le suivi A propos Données & Confidentialité Paramètres par défaut diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 77bac8aa6..47b9b2eb9 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -30,6 +30,7 @@ Ricevuto La nostra storia inizia qui Inviato a + Autorizza il tracciamento Chi siamo Dati e privacy Impostazioni predefinite diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c86de8999..ba0ed3940 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -35,6 +35,7 @@ Received Our story begins here Sent + Authorize tracking About Data & Privacy Default settings