コード例 #1
0
  public void highlightDates(Collection<Date> dates) {
    for (Date date : dates) {
      validateDate(date);

      MonthCellWithMonthIndex monthCellWithMonthIndex = getMonthCellWithIndexByDate(date);
      if (monthCellWithMonthIndex != null) {
        Calendar newlyHighlightedCal = Calendar.getInstance();
        newlyHighlightedCal.setTime(date);
        MonthCellDescriptor cell = monthCellWithMonthIndex.cell;

        highlightedCells.add(cell);
        highlightedCals.add(newlyHighlightedCal);
        cell.setHighlighted(true);
      }
    }

    adapter.notifyDataSetChanged();
    setAdapter(adapter);
  }
コード例 #2
0
 private void validateAndUpdate() {
   if (getAdapter() == null) {
     setAdapter(adapter);
   }
   adapter.notifyDataSetChanged();
 }