Ejemplo n.º 1
0
 @Override
 protected String writeToModelAfterInitialized(Task task) {
   long dueDate = dateAndTimePicker.constructDueDate();
   if (dueDate != task.getValue(Task.DUE_DATE)) // Clear snooze if due date has changed
   task.setValue(Task.REMINDER_SNOOZE, 0L);
   task.setValue(Task.DUE_DATE, dueDate);
   return null;
 }
Ejemplo n.º 2
0
  @Override
  protected void refreshDisplayView() {
    StringBuilder displayString = new StringBuilder();
    boolean isOverdue;
    if (initialized) {
      isOverdue = !dateAndTimePicker.isAfterNow();
      displayString.append(dateAndTimePicker.getDisplayString(activity, isQuickadd, isQuickadd));
    } else {
      isOverdue = model.getValue(Task.DUE_DATE) < DateUtilities.now();
      displayString.append(
          DateAndTimePicker.getDisplayString(
              activity, model.getValue(Task.DUE_DATE), isQuickadd, isQuickadd, false));
    }

    if (!isQuickadd && repeatControlSet != null) {
      String repeatString = repeatControlSet.getStringForExternalDisplay();
      if (!TextUtils.isEmpty(repeatString)) {
        displayString.append("\n"); // $NON-NLS-1$
        displayString.append(repeatString);
      }
    }
    TextView dateDisplay = (TextView) getDisplayView().findViewById(R.id.display_row_edit);
    if (TextUtils.isEmpty(displayString)) {
      dateDisplay.setText(R.string.TEA_deadline_hint);
      dateDisplay.setTextColor(unsetColor);
      image.setImageResource(R.drawable.tea_icn_date_gray);
    } else {
      dateDisplay.setText(displayString);
      if (isOverdue) {
        dateDisplay.setTextColor(activity.getResources().getColor(R.color.red_theme_color));
        image.setImageResource(R.drawable.tea_icn_date_red);
      } else {
        dateDisplay.setTextColor(themeColor);
        image.setImageResource(
            ThemeService.getTaskEditDrawable(
                R.drawable.tea_icn_date, R.drawable.tea_icn_date_lightblue));
      }
    }
  }
Ejemplo n.º 3
0
 public boolean isDeadlineSet() {
   return (dateAndTimePicker != null && dateAndTimePicker.constructDueDate() != 0);
 }
Ejemplo n.º 4
0
 private void initializeWithDate(long dueDate) {
   dateAndTimePicker.initializeWithDate(dueDate);
 }