From 617a41c7c86ba0989600e46dbd595da8a046f2e6 Mon Sep 17 00:00:00 2001 From: timklge <2026103+timklge@users.noreply.github.com> Date: Sun, 11 May 2025 20:32:22 +0200 Subject: [PATCH] Do not open main menu on data field click (interferes with ride app swipe gesture) (#134) --- README.md | 2 +- .../de/timklge/karooheadwind/datatypes/HeadwindDirectionView.kt | 2 +- .../de/timklge/karooheadwind/datatypes/WeatherDataType.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d20ee16..4cc525f 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ After installing this app on your Karoo and opening it once from the main menu, - Tailwind with riding speed (graphical, 1x1 field): Shows an arrow indicating the current headwind direction next to a label reading your current speed and the speed of the tailwind. If you ride against a headwind of 5 mph, it will show "-5". If you ride in the same direction of a 5 mph wind, it will read "+5". Text and arrow are colored based on the tailwind speed, with red indicating a strong headwind and green indicating a strong tailwind. - Tailwind (graphical, 1x1 field): Similar to the tailwind and riding speed field, but shows tailwind speed, wind speed and wind gust speed instead of riding speed. - Weather forecast (graphical, 2x1 field): Shows three columns indicating the current weather conditions (sunny, cloudy, ...), wind direction, precipitation and temperature forecasted for the next three hours. Tap on this widget to cycle through the 12 hour forecast. If you have a route loaded, the forecast widget will show the forecasted weather along points of the route, with an estimated traveled distance per hour of 20 km / 12 miles by default. -- Current weather (graphical, 1x1 field): Shows current weather conditions (same as forecast widget, but only for the current time). Tap on this widget to open the headwind app with a forecast overview. +- Current weather (graphical, 1x1 field): Shows current weather conditions (same as forecast widget, but only for the current time). - Relative grade (numerical): Shows the relative grade. The relative grade is calculated by estimating the force of the headwind, and then calculating the gradient you would need to ride at to experience this resistance if there was no wind. Example: If you are riding on an actual gradient of 2 %, face a headwind of 18 km/h while riding at 29 km/h, the relative grade will be shown as 5.2 % (with 3.2 % added to the actual grade due to the headwind). - Relative elevation gain (numerical): Shows the relative elegation gain. The relative elevation gain is calculated using the relative grade and is an estimation of how much climbing would have been equivalent to the headwind you faced during the ride. - Additionally, data fields that only show the current data value for headwind speed, humidity, cloud cover, absolute wind speed, absolute wind gust speed, absolute wind direction, rainfall and surface pressure can be added if desired. diff --git a/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/HeadwindDirectionView.kt b/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/HeadwindDirectionView.kt index 69b6860..e8ee2c5 100644 --- a/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/HeadwindDirectionView.kt +++ b/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/HeadwindDirectionView.kt @@ -67,7 +67,7 @@ fun HeadwindDirection( val baseModifier = GlanceModifier.fillMaxSize().padding(5.dp).background(dayColor, nightColor).cornerRadius(10.dp) Box( - modifier = if (!preview) baseModifier.clickable(actionStartActivity()) else baseModifier, + modifier = baseModifier, // TODO if (!preview) baseModifier.clickable(actionStartActivity()) else baseModifier, contentAlignment = Alignment( vertical = Alignment.Vertical.CenterVertically, horizontal = Alignment.Horizontal.CenterHorizontally, diff --git a/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/WeatherDataType.kt b/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/WeatherDataType.kt index 9ec50a8..22aff6e 100644 --- a/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/WeatherDataType.kt +++ b/app/src/main/kotlin/de/timklge/karooheadwind/datatypes/WeatherDataType.kt @@ -140,7 +140,7 @@ class WeatherDataType( val result = glance.compose(context, DpSize.Unspecified) { var modifier = GlanceModifier.fillMaxSize() - if (!config.preview) modifier = modifier.clickable(onClick = actionStartActivity()) + // TODO reenable once swipes are no longer interpreted as clicks if (!config.preview) modifier = modifier.clickable(onClick = actionStartActivity()) Box(modifier = modifier, contentAlignment = Alignment.CenterEnd) { Weather(