|
|
|
@ -32,7 +32,6 @@ class ViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
private final CheckBoxes checkBoxes;
|
|
|
|
private final CheckBoxes checkBoxes;
|
|
|
|
private final TagFormatter tagFormatter;
|
|
|
|
private final TagFormatter tagFormatter;
|
|
|
|
private final int textColorSecondary;
|
|
|
|
private final int textColorSecondary;
|
|
|
|
private final int textColorHint;
|
|
|
|
|
|
|
|
private final TaskDao taskDao;
|
|
|
|
private final TaskDao taskDao;
|
|
|
|
private final ViewHolderCallbacks callback;
|
|
|
|
private final ViewHolderCallbacks callback;
|
|
|
|
private final DisplayMetrics metrics;
|
|
|
|
private final DisplayMetrics metrics;
|
|
|
|
@ -73,7 +72,6 @@ class ViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
TagFormatter tagFormatter,
|
|
|
|
TagFormatter tagFormatter,
|
|
|
|
int textColorOverdue,
|
|
|
|
int textColorOverdue,
|
|
|
|
int textColorSecondary,
|
|
|
|
int textColorSecondary,
|
|
|
|
int textColorHint,
|
|
|
|
|
|
|
|
TaskDao taskDao,
|
|
|
|
TaskDao taskDao,
|
|
|
|
ViewHolderCallbacks callback,
|
|
|
|
ViewHolderCallbacks callback,
|
|
|
|
DisplayMetrics metrics,
|
|
|
|
DisplayMetrics metrics,
|
|
|
|
@ -86,7 +84,6 @@ class ViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
this.tagFormatter = tagFormatter;
|
|
|
|
this.tagFormatter = tagFormatter;
|
|
|
|
this.textColorOverdue = textColorOverdue;
|
|
|
|
this.textColorOverdue = textColorOverdue;
|
|
|
|
this.textColorSecondary = textColorSecondary;
|
|
|
|
this.textColorSecondary = textColorSecondary;
|
|
|
|
this.textColorHint = textColorHint;
|
|
|
|
|
|
|
|
this.taskDao = taskDao;
|
|
|
|
this.taskDao = taskDao;
|
|
|
|
this.callback = callback;
|
|
|
|
this.callback = callback;
|
|
|
|
this.metrics = metrics;
|
|
|
|
this.metrics = metrics;
|
|
|
|
@ -190,15 +187,12 @@ class ViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setTaskAppearance() {
|
|
|
|
private void setTaskAppearance() {
|
|
|
|
boolean completed = task.isCompleted();
|
|
|
|
if (task.isCompleted()) {
|
|
|
|
|
|
|
|
nameView.setEnabled(false);
|
|
|
|
TextView name = nameView;
|
|
|
|
nameView.setPaintFlags(nameView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
|
|
|
|
if (completed) {
|
|
|
|
|
|
|
|
name.setEnabled(false);
|
|
|
|
|
|
|
|
name.setPaintFlags(name.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
name.setEnabled(true);
|
|
|
|
nameView.setEnabled(true);
|
|
|
|
name.setPaintFlags(name.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
|
|
|
|
nameView.setPaintFlags(nameView.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setupDueDateAndTags();
|
|
|
|
setupDueDateAndTags();
|
|
|
|
@ -235,12 +229,6 @@ class ViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
String dateValue = DateUtilities.getRelativeDateStringWithTime(context, dueDate);
|
|
|
|
String dateValue = DateUtilities.getRelativeDateStringWithTime(context, dueDate);
|
|
|
|
dueDateView.setText(dateValue);
|
|
|
|
dueDateView.setText(dateValue);
|
|
|
|
dueDateView.setVisibility(View.VISIBLE);
|
|
|
|
dueDateView.setVisibility(View.VISIBLE);
|
|
|
|
} else if (task.isCompleted()) {
|
|
|
|
|
|
|
|
String dateValue =
|
|
|
|
|
|
|
|
DateUtilities.getRelativeDateStringWithTime(context, task.getCompletionDate());
|
|
|
|
|
|
|
|
dueDateView.setText(context.getResources().getString(R.string.TAd_completed, dateValue));
|
|
|
|
|
|
|
|
dueDateView.setTextColor(textColorHint);
|
|
|
|
|
|
|
|
dueDateView.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
dueDateView.setVisibility(View.GONE);
|
|
|
|
dueDateView.setVisibility(View.GONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|