From 2e65ff4e90d2eece475f4893cd24f93734c5926c Mon Sep 17 00:00:00 2001 From: Puneet Prakash Date: Tue, 29 Oct 2024 15:29:04 -0700 Subject: [PATCH] fix for refreshing Advanced Options Name field everytime a new TraceConfiguration is selected --- .../java/com/arcgismaps/toolkit/utilitynetworks/TraceState.kt | 3 +-- .../toolkit/utilitynetworks/ui/TraceOptionsScreen.kt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/toolkit/utilitynetworks/src/main/java/com/arcgismaps/toolkit/utilitynetworks/TraceState.kt b/toolkit/utilitynetworks/src/main/java/com/arcgismaps/toolkit/utilitynetworks/TraceState.kt index e23f85530..0dbeee765 100644 --- a/toolkit/utilitynetworks/src/main/java/com/arcgismaps/toolkit/utilitynetworks/TraceState.kt +++ b/toolkit/utilitynetworks/src/main/java/com/arcgismaps/toolkit/utilitynetworks/TraceState.kt @@ -145,11 +145,10 @@ public class TraceState( private var _isTaskInProgress: MutableState = mutableStateOf(false) internal val isTaskInProgress: State = _isTaskInProgress - private var _currentTraceName: MutableState = mutableStateOf("") - private var _currentScreen: MutableState = mutableStateOf(TraceNavRoute.TraceOptions) private val currentScreen: State = _currentScreen + private var _currentTraceName: MutableState = mutableStateOf("") /** * The default name of the trace. * diff --git a/toolkit/utilitynetworks/src/main/java/com/arcgismaps/toolkit/utilitynetworks/ui/TraceOptionsScreen.kt b/toolkit/utilitynetworks/src/main/java/com/arcgismaps/toolkit/utilitynetworks/ui/TraceOptionsScreen.kt index ba2eadde0..76a030cc8 100644 --- a/toolkit/utilitynetworks/src/main/java/com/arcgismaps/toolkit/utilitynetworks/ui/TraceOptionsScreen.kt +++ b/toolkit/utilitynetworks/src/main/java/com/arcgismaps/toolkit/utilitynetworks/ui/TraceOptionsScreen.kt @@ -344,7 +344,7 @@ internal fun AdvancedOptions( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween ) { - var text by rememberSaveable { mutableStateOf(defaultTraceName) } + var text by remember(defaultTraceName) { mutableStateOf(defaultTraceName) } OutlinedTextField( value = text, onValueChange = { newValue ->