From d97d7046a6f41785befdb1797cac678897ce8a84 Mon Sep 17 00:00:00 2001 From: alexandreferris Date: Tue, 27 Aug 2024 09:30:18 +0200 Subject: [PATCH 1/3] chore: add todo to move verification logic to usecase when merged to develop Signed-off-by: alexandreferris --- .../android/ui/home/settings/privacy/PrivacySettingsViewModel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsViewModel.kt index 4c9b5abb94e..dca52c5c24e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsViewModel.kt @@ -90,6 +90,7 @@ class PrivacySettingsViewModel @Inject constructor( } viewModelScope.launch { + // TODO(Analytics): To be changed with UseCase val isAnalyticsConfigurationEnabled = analyticsEnabled is AnalyticsConfiguration.Enabled val isValidBackend = when (val serverConfig = selfServerConfig()) { is SelfServerConfigUseCase.Result.Success -> From a392e77a039a3a2333fa2a2f740bdffdd53524b3 Mon Sep 17 00:00:00 2001 From: alexandreferris Date: Tue, 27 Aug 2024 09:30:48 +0200 Subject: [PATCH 2/3] fix: add proper usage of state attribute for verification when to show the analytics toggle Signed-off-by: alexandreferris --- .../ui/home/settings/privacy/PrivacySettingsScreen.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt index 974812ddc5d..ba103bddeaa 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt @@ -51,6 +51,7 @@ fun PrivacySettingsConfigScreen( with(viewModel) { PrivacySettingsScreenContent( isAnonymousUsageDataEnabled = state.isAnalyticsUsageEnabled, + shouldShowAnalyticsUsage = state.shouldShowAnalyticsUsage, areReadReceiptsEnabled = state.areReadReceiptsEnabled, setReadReceiptsState = ::setReadReceiptsState, isTypingIndicatorEnabled = state.isTypingIndicatorEnabled, @@ -66,6 +67,7 @@ fun PrivacySettingsConfigScreen( @Composable fun PrivacySettingsScreenContent( isAnonymousUsageDataEnabled: Boolean, + shouldShowAnalyticsUsage: Boolean, areReadReceiptsEnabled: Boolean, setReadReceiptsState: (Boolean) -> Unit, isTypingIndicatorEnabled: Boolean, @@ -91,7 +93,7 @@ fun PrivacySettingsScreenContent( .fillMaxSize() .padding(internalPadding) ) { - if (BuildConfig.ANALYTICS_ENABLED) { + if (shouldShowAnalyticsUsage) { GroupConversationOptionsItem( title = stringResource(id = R.string.settings_send_anonymous_usage_data_title), switchState = SwitchState.Enabled(value = isAnonymousUsageDataEnabled, onCheckedChange = setAnonymousUsageDataEnabled), @@ -143,6 +145,7 @@ fun PrivacySettingsScreenContent( fun PreviewSendReadReceipts() = WireTheme { PrivacySettingsScreenContent( isAnonymousUsageDataEnabled = true, + shouldShowAnalyticsUsage = true, areReadReceiptsEnabled = true, setReadReceiptsState = {}, isTypingIndicatorEnabled = true, From 2453c896e91d47c867e4c21fb1cce2e93693adf8 Mon Sep 17 00:00:00 2001 From: alexandreferris Date: Tue, 27 Aug 2024 09:33:11 +0200 Subject: [PATCH 3/3] chore: detekt Signed-off-by: alexandreferris --- .../android/ui/home/settings/privacy/PrivacySettingsScreen.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt index ba103bddeaa..e1e791b2046 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt @@ -26,7 +26,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import com.ramcosta.composedestinations.annotation.RootNavGraph -import com.wire.android.BuildConfig import com.wire.android.R import com.wire.android.navigation.Navigator import com.wire.android.ui.common.colorsScheme