Ejemplo n.º 1
0
    public void bind(int index) {
      Weight w = weights.get(index);
      date.setText(EnvUtil.getFormattedDate(w.getDate()));
      value.setText(EnvUtil.formatWeight(EnvUtil.getProperValue(w, ctx)));

      unit.setText(EnvUtil.getLocalUnitString(ctx));
      delete.setOnClickListener(
          view -> {
            Log.d(TAG, String.format("delete = %d", index));
            remove(w);
          });
    }
Ejemplo n.º 2
0
 public void remove(Weight w) {
   notifyItemRemoved(weights.indexOf(w));
   w.delete();
   weights.remove(w);
 }