From 48dfc0c10e4ac86be9dca7fd3fecf19f032d4edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Santos?= Date: Tue, 29 Oct 2024 18:14:58 +0000 Subject: [PATCH] Disable transition animations --- .../ui/choosewebsites/ChooseWebsitesScreen.kt | 5 ++++- .../ooni/probe/ui/dashboard/DashboardScreen.kt | 1 + .../ooni/probe/ui/descriptor/DescriptorScreen.kt | 15 +++++++++------ .../ui/descriptor/add/AddDescriptorScreen.kt | 4 +++- .../ui/descriptor/review/ReviewUpdatesScreen.kt | 3 ++- .../kotlin/org/ooni/probe/ui/log/LogScreen.kt | 3 ++- .../probe/ui/measurement/MeasurementScreen.kt | 3 ++- .../org/ooni/probe/ui/navigation/Navigation.kt | 6 ++++++ .../org/ooni/probe/ui/result/ResultScreen.kt | 2 +- .../org/ooni/probe/ui/results/ResultsScreen.kt | 2 +- .../kotlin/org/ooni/probe/ui/run/RunScreen.kt | 3 ++- .../org/ooni/probe/ui/settings/SettingsScreen.kt | 4 +++- .../ooni/probe/ui/settings/about/AboutScreen.kt | 3 ++- .../settings/category/SettingsCategoryScreen.kt | 4 +++- .../ooni/probe/ui/settings/proxy/ProxyScreen.kt | 3 ++- 15 files changed, 43 insertions(+), 18 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/choosewebsites/ChooseWebsitesScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/choosewebsites/ChooseWebsitesScreen.kt index 0f06e552..f26c6d2d 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/choosewebsites/ChooseWebsitesScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/choosewebsites/ChooseWebsitesScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.choosewebsites +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues @@ -51,7 +52,9 @@ fun ChooseWebsitesScreen( onEvent: (ChooseWebsitesViewModel.Event) -> Unit, ) { Column( - modifier = Modifier.padding(WindowInsets.navigationBars.asPaddingValues()), + modifier = Modifier + .padding(WindowInsets.navigationBars.asPaddingValues()) + .background(MaterialTheme.colorScheme.background), ) { TopBar( title = { Text(stringResource(Res.string.Settings_Websites_CustomURL_Title)) }, diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/dashboard/DashboardScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/dashboard/DashboardScreen.kt index ce655b45..d3e596b8 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/dashboard/DashboardScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/dashboard/DashboardScreen.kt @@ -73,6 +73,7 @@ fun DashboardScreen( PullToRefreshBox( isRefreshing = state.isRefreshing, onRefresh = { onEvent(DashboardViewModel.Event.FetchUpdatedDescriptors) }, + modifier = Modifier.background(MaterialTheme.colorScheme.background), ) { // Colorful top background Column( diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/DescriptorScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/DescriptorScreen.kt index 86987b22..bd43ef11 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/DescriptorScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/DescriptorScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.descriptor +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -70,12 +71,14 @@ fun DescriptorScreen( val pullRefreshState = rememberPullToRefreshState() Box( - Modifier.pullToRefresh( - isRefreshing = state.isRefreshing, - onRefresh = { onEvent(DescriptorViewModel.Event.FetchUpdatedDescriptor) }, - state = pullRefreshState, - enabled = descriptor.source is Descriptor.Source.Installed, - ), + Modifier + .pullToRefresh( + isRefreshing = state.isRefreshing, + onRefresh = { onEvent(DescriptorViewModel.Event.FetchUpdatedDescriptor) }, + state = pullRefreshState, + enabled = descriptor.source is Descriptor.Source.Installed, + ) + .background(MaterialTheme.colorScheme.background), ) { Column { val descriptorColor = descriptor.color ?: MaterialTheme.colorScheme.primary diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/add/AddDescriptorScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/add/AddDescriptorScreen.kt index 744f981b..8580266f 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/add/AddDescriptorScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/add/AddDescriptorScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.descriptor.add +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -14,6 +15,7 @@ import androidx.compose.material.icons.filled.Close import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Switch import androidx.compose.material3.Text import androidx.compose.material3.TextButton @@ -45,7 +47,7 @@ fun AddDescriptorScreen( onEvent: (AddDescriptorViewModel.Event) -> Unit, ) { state.descriptor?.let { descriptor -> - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(Res.string.AddDescriptor_Title)) diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/review/ReviewUpdatesScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/review/ReviewUpdatesScreen.kt index 300d5428..f0397aef 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/review/ReviewUpdatesScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/descriptor/review/ReviewUpdatesScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.descriptor.review +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -42,7 +43,7 @@ fun ReviewUpdatesScreen( state.descriptors.size }) val currentDescriptorIndex = state.currentDescriptorIndex + 1 - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(Res.string.Dashboard_ReviewDescriptor_Label, currentDescriptorIndex, state.descriptors.size)) }, actions = { diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/log/LogScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/log/LogScreen.kt index aa832229..8599de96 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/log/LogScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/log/LogScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.log +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.PaddingValues @@ -54,7 +55,7 @@ fun LogScreen( state: LogViewModel.State, onEvent: (LogViewModel.Event) -> Unit, ) { - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(Res.string.logs)) }, navigationIcon = { diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/measurement/MeasurementScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/measurement/MeasurementScreen.kt index 80e49689..8974bba0 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/measurement/MeasurementScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/measurement/MeasurementScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.measurement +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.asPaddingValues @@ -66,7 +67,7 @@ fun MeasurementScreen( }, ) - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(Res.string.measurement)) diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/navigation/Navigation.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/navigation/Navigation.kt index 1de73261..1d9540b0 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/navigation/Navigation.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/navigation/Navigation.kt @@ -1,5 +1,7 @@ package org.ooni.probe.ui.navigation +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -49,6 +51,10 @@ fun Navigation( NavHost( navController = navController, startDestination = START_SCREEN.route, + enterTransition = { EnterTransition.None }, + exitTransition = { ExitTransition.None }, + popEnterTransition = { EnterTransition.None }, + popExitTransition = { ExitTransition.None }, modifier = Modifier.fillMaxSize(), ) { composable(route = Screen.Onboarding.route) { diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/result/ResultScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/result/ResultScreen.kt index 9bafd0ce..2d0e8385 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/result/ResultScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/result/ResultScreen.kt @@ -83,7 +83,7 @@ fun ResultScreen( ) { var showRerunConfirmation by remember { mutableStateOf(false) } - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { val descriptorColor = state.result?.descriptor?.color ?: MaterialTheme.colorScheme.primary val onDescriptorColor = LocalCustomColors.current.onDescriptor TopBar( diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/results/ResultsScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/results/ResultsScreen.kt index a9bd66de..e893a3ef 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/results/ResultsScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/results/ResultsScreen.kt @@ -75,7 +75,7 @@ fun ResultsScreen( ) { var showDeleteConfirm by remember { mutableStateOf(false) } - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(Res.string.TestResults_Overview_Title)) diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/run/RunScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/run/RunScreen.kt index 45b62928..8648864f 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/run/RunScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/run/RunScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.run +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -81,7 +82,7 @@ fun RunScreen( ) { var showVpnWarning by remember { mutableStateOf(false) } - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(Res.string.Dashboard_RunTests_Title)) }, navigationIcon = { diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/SettingsScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/SettingsScreen.kt index 2e6bece6..729c6c68 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/SettingsScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/SettingsScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.settings +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.size @@ -7,6 +8,7 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Icon import androidx.compose.material3.ListItem +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -24,7 +26,7 @@ fun SettingsScreen( state: SettingsViewModel.State, onEvent: (SettingsViewModel.Event) -> Unit, ) { - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(Res.string.Settings_Title)) diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/about/AboutScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/about/AboutScreen.kt index 9234d774..c26cd225 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/about/AboutScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/about/AboutScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.settings.about +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -40,7 +41,7 @@ fun AboutScreen( softwareName: String, softwareVersion: String, ) { - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { Surface(color = MaterialTheme.colorScheme.primaryContainer) { Column( horizontalAlignment = Alignment.CenterHorizontally, diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/category/SettingsCategoryScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/category/SettingsCategoryScreen.kt index ae2d426d..28d8552c 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/category/SettingsCategoryScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/category/SettingsCategoryScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.settings.category +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -19,6 +20,7 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.ListItem +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Switch import androidx.compose.material3.Text @@ -54,7 +56,7 @@ fun SettingsCategoryScreen( ) { val category = state.category ?: return - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(category.title)) diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/proxy/ProxyScreen.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/proxy/ProxyScreen.kt index 706955ef..ea271a8a 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/proxy/ProxyScreen.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/ui/settings/proxy/ProxyScreen.kt @@ -1,5 +1,6 @@ package org.ooni.probe.ui.settings.proxy +import androidx.compose.foundation.background import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.PressInteraction import androidx.compose.foundation.layout.Arrangement @@ -50,7 +51,7 @@ fun ProxyScreen( state: ProxyViewModel.State, onEvent: (ProxyViewModel.Event) -> Unit, ) { - Column { + Column(Modifier.background(MaterialTheme.colorScheme.background)) { TopBar( title = { Text(stringResource(Res.string.Settings_Proxy_Enabled))