Show zero value on bars to indicate sensor availability to the user (#56)
This commit is contained in:
parent
34c87f68ab
commit
d30bcb7abe
@ -369,7 +369,7 @@ class Window(
|
|||||||
} else {
|
} else {
|
||||||
context.getColor(R.color.zone0)
|
context.getColor(R.color.zone0)
|
||||||
}
|
}
|
||||||
powerbar.progress = if (value > 0) progress else null
|
powerbar.progress = progress
|
||||||
powerbar.label = "$value"
|
powerbar.label = "$value"
|
||||||
|
|
||||||
Log.d(TAG, "Speed: $value min: $minSpeed max: $maxSpeed")
|
Log.d(TAG, "Speed: $value min: $minSpeed max: $maxSpeed")
|
||||||
@ -421,14 +421,10 @@ class Window(
|
|||||||
|
|
||||||
powerbarsWithGradeSource.forEach { powerbar ->
|
powerbarsWithGradeSource.forEach { powerbar ->
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
if (value.absoluteValue >= 0.5) {
|
val minGradient = streamData.settings?.minGradient ?: PowerbarSettings.defaultMinGradient
|
||||||
val minGradient = streamData.settings?.minGradient ?: PowerbarSettings.defaultMinGradient
|
val maxGradient = streamData.settings?.maxGradient ?: PowerbarSettings.defaultMaxGradient
|
||||||
val maxGradient = streamData.settings?.maxGradient ?: PowerbarSettings.defaultMaxGradient
|
|
||||||
|
|
||||||
powerbar.progress = remap(value.absoluteValue, minGradient.toDouble(), maxGradient.toDouble(), 0.0, 1.0)
|
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
|
val colorRes = getInclineIndicatorColor(value.toFloat()) ?: R.color.zone0
|
||||||
powerbar.progressColor = context.getColor(colorRes)
|
powerbar.progressColor = context.getColor(colorRes)
|
||||||
@ -482,7 +478,7 @@ class Window(
|
|||||||
} else {
|
} else {
|
||||||
context.getColor(R.color.zone0)
|
context.getColor(R.color.zone0)
|
||||||
}
|
}
|
||||||
powerbar.progress = if (value > 0) progress else null
|
powerbar.progress = progress
|
||||||
powerbar.label = "$value"
|
powerbar.label = "$value"
|
||||||
|
|
||||||
Log.d(TAG, "Cadence: $value min: $minCadence max: $maxCadence")
|
Log.d(TAG, "Cadence: $value min: $minCadence max: $maxCadence")
|
||||||
@ -533,7 +529,7 @@ class Window(
|
|||||||
} else {
|
} else {
|
||||||
context.getColor(R.color.zone0)
|
context.getColor(R.color.zone0)
|
||||||
}
|
}
|
||||||
powerbar.progress = if (value > 0) progress else null
|
powerbar.progress = progress
|
||||||
powerbar.label = "$value"
|
powerbar.label = "$value"
|
||||||
|
|
||||||
Log.d(TAG, "Hr: $value min: $minHr max: $maxHr")
|
Log.d(TAG, "Hr: $value min: $minHr max: $maxHr")
|
||||||
@ -591,7 +587,7 @@ class Window(
|
|||||||
} else {
|
} else {
|
||||||
context.getColor(R.color.zone0)
|
context.getColor(R.color.zone0)
|
||||||
}
|
}
|
||||||
powerbar.progress = if (value > 0) progress else null
|
powerbar.progress = progress
|
||||||
powerbar.label = "${value}W"
|
powerbar.label = "${value}W"
|
||||||
|
|
||||||
Log.d(TAG, "Power: $value min: $minPower max: $maxPower")
|
Log.d(TAG, "Power: $value min: $minPower max: $maxPower")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user