private void drawTextValue(String key, TrafficInfo trafInfo) { if (trafInfo.getValue(key) == TrafficInfo.initialValue) { valueViews.get(key).setText("N/A"); valueViews.get(key).setBackgroundResource(R.drawable.not_available_value); return; } valueViews.get(key).setText(trafInfo.getValue(key).toString()); if (!timestampIsActual(trafInfo.getTimestamp(key))) valueViews.get(key).setBackgroundResource(R.drawable.not_actual_value); else valueViews.get(key).setBackgroundResource(R.drawable.actual_value); }
private void drawValues(TrafficInfo trafInfo) { for (String key : TrafficInfo.getKeys()) { drawTextValue(key, trafInfo); } }
private void drawData(TrafficInfo trafInfo) { zipText.setTextAppearance(getContext(), R.style.boldItalicText); zipText.setText(Integer.valueOf(trafInfo.getZip()).toString()); drawValues(trafInfo); }