use of com.health.openscale.gui.measurement.UserMeasurementView in project openScale by oliexdev.
the class TableFragment method updateOnView.
public void updateOnView(List<ScaleMeasurement> scaleMeasurementList) {
tableHeaderView.removeAllViews();
final int iconHeight = pxImageDp(20);
ArrayList<MeasurementView> visibleMeasurements = new ArrayList<>();
for (MeasurementView measurement : measurementViews) {
if (!measurement.isVisible() || measurement instanceof UserMeasurementView) {
continue;
}
ImageView headerIcon = new ImageView(tableView.getContext());
headerIcon.setImageDrawable(measurement.getIcon());
headerIcon.setColorFilter(ColorUtil.getTintColor(tableView.getContext()));
headerIcon.setLayoutParams(new TableRow.LayoutParams(0, iconHeight, 1));
headerIcon.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
tableHeaderView.addView(headerIcon);
visibleMeasurements.add(measurement);
}
adapter.setMeasurements(visibleMeasurements, scaleMeasurementList);
}
Aggregations