diff --git a/app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/AlertCheckLogViewerScreen.kt b/app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/AlertCheckLogViewerScreen.kt index 9c53097..b2b2471 100644 --- a/app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/AlertCheckLogViewerScreen.kt +++ b/app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/AlertCheckLogViewerScreen.kt @@ -73,6 +73,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.Clipboard import androidx.compose.ui.platform.LocalClipboard +import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign @@ -613,6 +614,7 @@ private fun ActiveFiltersSection( modifier: Modifier = Modifier, onClearFilter: (String) -> Unit, ) { + val locale = LocalConfiguration.current.locales[0] Column( modifier = modifier @@ -724,14 +726,14 @@ private fun ActiveFiltersSection( dateRange.first != null -> { "From ${ - SimpleDateFormat("MMM dd", Locale.getDefault()) + SimpleDateFormat("MMM dd", locale) .format(Date(dateRange.first!!)) }" } else -> { "Until ${ - SimpleDateFormat("MMM dd", Locale.getDefault()) + SimpleDateFormat("MMM dd", locale) .format(Date(dateRange.second!!)) }" } diff --git a/app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/FilterLogsUi.kt b/app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/FilterLogsUi.kt index 91d8e03..b20280c 100644 --- a/app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/FilterLogsUi.kt +++ b/app/src/main/java/dev/hossain/remotenotify/ui/alertchecklog/FilterLogsUi.kt @@ -25,6 +25,7 @@ import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -46,6 +47,7 @@ internal fun FilterBottomSheetContent( onClearFilters: () -> Unit, onClose: () -> Unit, ) { + val locale = LocalConfiguration.current.locales[0] Column( modifier = Modifier @@ -158,7 +160,7 @@ internal fun FilterBottomSheetContent( OutlinedTextField( value = if (currentState.dateRange.first != null) { - SimpleDateFormat("MMM dd, yyyy", Locale.getDefault()) + SimpleDateFormat("MMM dd, yyyy", locale) .format(Date(currentState.dateRange.first!!)) } else { "" @@ -181,7 +183,7 @@ internal fun FilterBottomSheetContent( OutlinedTextField( value = if (currentState.dateRange.second != null) { - SimpleDateFormat("MMM dd, yyyy", Locale.getDefault()) + SimpleDateFormat("MMM dd, yyyy", locale) .format(Date(currentState.dateRange.second!!)) } else { "" diff --git a/app/src/main/java/dev/hossain/remotenotify/ui/devportal/DeveloperPortalScreen.kt b/app/src/main/java/dev/hossain/remotenotify/ui/devportal/DeveloperPortalScreen.kt index c446d51..7fda94c 100644 --- a/app/src/main/java/dev/hossain/remotenotify/ui/devportal/DeveloperPortalScreen.kt +++ b/app/src/main/java/dev/hossain/remotenotify/ui/devportal/DeveloperPortalScreen.kt @@ -540,8 +540,8 @@ fun DeveloperPortalUi( val scope = rememberCoroutineScope() // Show snackbar when simulation result changes - state.simulationResult?.let { result -> - scope.launch { + LaunchedEffect(state.simulationResult) { + state.simulationResult?.let { result -> snackbarHostState.showSnackbar(result) } }