Show zero value on bars to indicate sensor availability to the user (#56)

This commit is contained in:
timklge 2025-08-15 22:25:43 +02:00 committed by GitHub
parent 34c87f68ab
commit d30bcb7abe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -369,7 +369,7 @@ class Window(
} else {
context.getColor(R.color.zone0)
}
powerbar.progress = if (value > 0) progress else null
powerbar.progress = progress
powerbar.label = "$value"
Log.d(TAG, "Speed: $value min: $minSpeed max: $maxSpeed")
@ -421,14 +421,10 @@ class Window(
powerbarsWithGradeSource.forEach { powerbar ->
if (value != null) {
if (value.absoluteValue >= 0.5) {
val minGradient = streamData.settings?.minGradient ?: PowerbarSettings.defaultMinGradient
val maxGradient = streamData.settings?.maxGradient ?: PowerbarSettings.defaultMaxGradient
powerbar.progress = remap(value.absoluteValue, minGradient.toDouble(), maxGradient.toDouble(), 0.0, 1.0)
} else {
powerbar.progress = null
}
val colorRes = getInclineIndicatorColor(value.toFloat()) ?: R.color.zone0
powerbar.progressColor = context.getColor(colorRes)
@ -482,7 +478,7 @@ class Window(
} else {
context.getColor(R.color.zone0)
}
powerbar.progress = if (value > 0) progress else null
powerbar.progress = progress
powerbar.label = "$value"
Log.d(TAG, "Cadence: $value min: $minCadence max: $maxCadence")
@ -533,7 +529,7 @@ class Window(
} else {
context.getColor(R.color.zone0)
}
powerbar.progress = if (value > 0) progress else null
powerbar.progress = progress
powerbar.label = "$value"
Log.d(TAG, "Hr: $value min: $minHr max: $maxHr")
@ -591,7 +587,7 @@ class Window(
} else {
context.getColor(R.color.zone0)
}
powerbar.progress = if (value > 0) progress else null
powerbar.progress = progress
powerbar.label = "${value}W"
Log.d(TAG, "Power: $value min: $minPower max: $maxPower")