use of com.android.tools.datastore.DataStoreSeries in project android by JetBrains.
the class NetworkRadioSegment method createComponentsList.
@Override
public void createComponentsList(@NotNull List<Animatable> animatables) {
EnumMap<RadioState, Color> colorsMap = getRadioStateColor();
EnumMap<RadioState, String> labelsMap = getRadioStateLabel();
mRadioChart = new StateChart(colorsMap);
mRadioChart.addSeries(new RangedSeries<>(myTimeCurrentRangeUs, new DataStoreSeries<>(mDataStore, SeriesDataType.NETWORK_RADIO)));
mNetworkTypeChart = new StateChart<>(getNetworkTypeColor());
mNetworkTypeChart.setRenderMode(StateChart.RenderMode.TEXT);
mNetworkTypeChart.addSeries(new RangedSeries<>(myTimeCurrentRangeUs, new DataStoreSeries<>(mDataStore, SeriesDataType.NETWORK_TYPE)));
List<LegendRenderData> legendRenderDataList = new ArrayList<>();
for (RadioState state : RadioState.values()) {
LegendRenderData renderData = new LegendRenderData(LegendRenderData.IconType.LINE, colorsMap.get(state), labelsMap.get(state));
legendRenderDataList.add(renderData);
}
mLegendComponent = new LegendComponent(LegendComponent.Orientation.HORIZONTAL, 100);
mLegendComponent.setLegendData(legendRenderDataList);
animatables.add(mNetworkTypeChart);
animatables.add(mRadioChart);
animatables.add(mLegendComponent);
}
Aggregations