Speed Zones Chart: remove unused legend code
parent
6fb0a977fc
commit
b4639b9062
|
@ -24,7 +24,6 @@ import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.github.mikephil.charting.charts.Chart;
|
import com.github.mikephil.charting.charts.Chart;
|
||||||
import com.github.mikephil.charting.charts.HorizontalBarChart;
|
import com.github.mikephil.charting.charts.HorizontalBarChart;
|
||||||
import com.github.mikephil.charting.components.LegendEntry;
|
|
||||||
import com.github.mikephil.charting.components.XAxis;
|
import com.github.mikephil.charting.components.XAxis;
|
||||||
import com.github.mikephil.charting.components.YAxis;
|
import com.github.mikephil.charting.components.YAxis;
|
||||||
import com.github.mikephil.charting.data.BarData;
|
import com.github.mikephil.charting.data.BarData;
|
||||||
|
@ -130,31 +129,14 @@ public class SpeedZonesFragment extends AbstractChartFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setupLegend(Chart chart) {
|
protected List<? extends ActivitySample> getSamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
|
||||||
List<LegendEntry> legendEntries = new ArrayList<>(3);
|
return super.getAllSamples(db, device, tsFrom, tsTo);
|
||||||
LegendEntry lightSleepEntry = new LegendEntry();
|
|
||||||
lightSleepEntry.label = akLightSleep.label;
|
|
||||||
lightSleepEntry.formColor = akLightSleep.color;
|
|
||||||
legendEntries.add(lightSleepEntry);
|
|
||||||
|
|
||||||
LegendEntry deepSleepEntry = new LegendEntry();
|
|
||||||
deepSleepEntry.label = akDeepSleep.label;
|
|
||||||
deepSleepEntry.formColor = akDeepSleep.color;
|
|
||||||
legendEntries.add(deepSleepEntry);
|
|
||||||
|
|
||||||
if (supportsHeartrate(getChartsHost().getDevice())) {
|
|
||||||
LegendEntry hrEntry = new LegendEntry();
|
|
||||||
hrEntry.label = HEARTRATE_LABEL;
|
|
||||||
hrEntry.formColor = HEARTRATE_COLOR;
|
|
||||||
legendEntries.add(hrEntry);
|
|
||||||
}
|
|
||||||
chart.getLegend().setCustom(legendEntries);
|
|
||||||
chart.getLegend().setTextColor(LEGEND_TEXT_COLOR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<? extends ActivitySample> getSamples(DBHandler db, GBDevice device, int tsFrom, int tsTo) {
|
protected void setupLegend(Chart chart) {
|
||||||
return super.getAllSamples(db, device, tsFrom, tsTo);
|
// no legend here, it is all about the steps here
|
||||||
|
chart.getLegend().setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue