From b973decc8fc6edf9ca6fd2e69e00a58b5b12c224 Mon Sep 17 00:00:00 2001 From: timklge <2026103+timklge@users.noreply.github.com> Date: Sun, 19 Jan 2025 19:42:32 +0100 Subject: [PATCH] fix #27: Make hourly forecast data field unclickable in preview mode (#28) --- .../karooheadwind/datatypes/WeatherForecastDataType.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/WeatherForecastDataType.kt b/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/WeatherForecastDataType.kt index 208914e..f974563 100644 --- a/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/WeatherForecastDataType.kt +++ b/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/WeatherForecastDataType.kt @@ -177,7 +177,11 @@ class WeatherForecastDataType( } val result = glance.compose(context, DpSize.Unspecified) { - Row(modifier = GlanceModifier.fillMaxSize().clickable(onClick = actionRunCallback()), horizontalAlignment = Alignment.Horizontal.CenterHorizontally) { + var modifier = GlanceModifier.fillMaxSize() + + if (!config.preview) modifier = modifier.clickable(onClick = actionRunCallback()) + + Row(modifier = modifier, horizontalAlignment = Alignment.Horizontal.CenterHorizontally) { val hourOffset = widgetSettings?.currentForecastHourOffset ?: 0 var previousDate: String? = let {