Swap red / blue colorization for pedal balance source (#66)
Some checks failed
Build / build (push) Failing after 7m55s
Some checks failed
Build / build (push) Failing after 7m55s
This commit is contained in:
parent
4f7a508740
commit
d5fae80d9d
@ -71,8 +71,8 @@ tasks.register("generateManifest") {
|
|||||||
"latestVersion" to android.defaultConfig.versionName,
|
"latestVersion" to android.defaultConfig.versionName,
|
||||||
"latestVersionCode" to android.defaultConfig.versionCode,
|
"latestVersionCode" to android.defaultConfig.versionCode,
|
||||||
"developer" to "github.com/timklge",
|
"developer" to "github.com/timklge",
|
||||||
"description" to "Open-source extension that adds colored power or heart rate progress bars to the edges of the screen, similar to the LEDs on Wahoo computers",
|
"description" to "Open-source extension that adds colored progress bars representing power, heart rate etc. to the edge of the screen, similar to the LED bars on older Wahoo computers",
|
||||||
"releaseNotes" to "* Fix gear bar refresh\n* Add german localization\n* Add gear data sources\n* Show zero value on bars to indicate sensor availability\n* Fix pedal balance values\n* Add pedal balance data source\n* Add option to split bars",
|
"releaseNotes" to "* Swap red / blue colorization for pedal balance source\n* Fix gear bar refresh\n* Add german localization\n* Add gear data sources\n* Show zero value on bars to indicate sensor availability\n* Fix pedal balance values",
|
||||||
"screenshotUrls" to listOf(
|
"screenshotUrls" to listOf(
|
||||||
"$baseUrl/powerbar_min.gif",
|
"$baseUrl/powerbar_min.gif",
|
||||||
"$baseUrl/powerbar0.png",
|
"$baseUrl/powerbar0.png",
|
||||||
|
|||||||
@ -227,11 +227,11 @@ class Window(
|
|||||||
powerbar.drawMode = ProgressBarDrawMode.CENTER_OUT
|
powerbar.drawMode = ProgressBarDrawMode.CENTER_OUT
|
||||||
|
|
||||||
if (streamData.powerBalanceLeft != null) {
|
if (streamData.powerBalanceLeft != null) {
|
||||||
val value = remap((powerBalanceLeft ?: 50.0).coerceIn(0.0, 100.0), 40.0, 60.0, 100.0, 0.0)
|
val value = remap(powerBalanceLeft.coerceIn(0.0, 100.0), 40.0, 60.0, 100.0, 0.0)
|
||||||
|
|
||||||
val percentLeft = (powerBalanceLeft ?: 50.0).roundToInt()
|
val percentLeft = powerBalanceLeft.roundToInt()
|
||||||
|
|
||||||
@ColorRes val zoneColorRes = if (percentLeft < 50) {
|
@ColorRes val zoneColorRes = if (percentLeft > 50) {
|
||||||
R.color.zone0
|
R.color.zone0
|
||||||
} else if (percentLeft == 50) {
|
} else if (percentLeft == 50) {
|
||||||
R.color.zone1
|
R.color.zone1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user