1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-28 19:45:50 +01:00

Workout page: allow empty values to be displayed

This commit is contained in:
a0z 2024-10-02 23:37:20 +02:00
parent 10da6a27ce
commit 3c40f3a9d7
2 changed files with 12 additions and 4 deletions

View File

@ -216,10 +216,10 @@ public class GarminWorkoutParser implements ActivitySummaryParser {
if (physiologicalMetrics != null) {
if (physiologicalMetrics.getAerobicEffect() != null) {
summaryData.add(TRAINING_EFFECT_AEROBIC, physiologicalMetrics.getAerobicEffect(), UNIT_NONE);
summaryData.add(TRAINING_EFFECT_AEROBIC, physiologicalMetrics.getAerobicEffect(), UNIT_NONE, true);
}
if (physiologicalMetrics.getAnaerobicEffect() != null) {
summaryData.add(TRAINING_EFFECT_ANAEROBIC, physiologicalMetrics.getAnaerobicEffect(), UNIT_NONE);
summaryData.add(TRAINING_EFFECT_ANAEROBIC, physiologicalMetrics.getAnaerobicEffect(), UNIT_NONE, true);
}
if (physiologicalMetrics.getMetMax() != null) {
summaryData.add(MAXIMUM_OXYGEN_UPTAKE, physiologicalMetrics.getMetMax().floatValue() * 3.5f, UNIT_ML_KG_MIN);

View File

@ -63,11 +63,19 @@ public class ActivitySummaryData {
}
public void add(final String key, final Number value, final String unit) {
add(null, key, value, unit);
add(null, key, value, unit, false);
}
public void add(final String key, final Number value, final String unit, boolean forceDisplay) {
add(null, key, value, unit, forceDisplay);
}
public void add(final String group, final String key, final Number value, final String unit) {
if (value.doubleValue() != 0) {
add(group, key, value, unit, false);
}
public void add(final String group, final String key, final Number value, final String unit, boolean forceDisplay) {
if (value.doubleValue() != 0 || forceDisplay) {
entries.put(key, new ActivitySummarySimpleEntry(group, value, unit));
}
}