History now shows an icon indicating if the task was done or deleted
@@ -67,8 +67,12 @@ public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerVi
|
|||||||
if (mIsToday) return;
|
if (mIsToday) return;
|
||||||
// Set alarm if past due date
|
// Set alarm if past due date
|
||||||
LocalDate dueDate = holder.mItem.getDueDate();
|
LocalDate dueDate = holder.mItem.getDueDate();
|
||||||
if(dueDate != null && dueDate.isBefore(LocalDate.now()))
|
if (holder.mItem.getDone() == 1)
|
||||||
holder.mAlarmView.setImageResource(R.drawable.ic_access_alarm);
|
holder.mIconView.setImageResource(R.drawable.ic_check_ligth);
|
||||||
|
else if (holder.mItem.getDeleted() == 1)
|
||||||
|
holder.mIconView.setImageResource(R.drawable.ic_close_light);
|
||||||
|
else if(dueDate != null && dueDate.isBefore(LocalDate.now()))
|
||||||
|
holder.mIconView.setImageResource(R.drawable.ic_access_alarm);
|
||||||
int priority = holder.mItem.getPriority();
|
int priority = holder.mItem.getPriority();
|
||||||
|
|
||||||
// Set priority
|
// Set priority
|
||||||
@@ -133,7 +137,7 @@ public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerVi
|
|||||||
class SimpleViewHolder extends RecyclerView.ViewHolder {
|
class SimpleViewHolder extends RecyclerView.ViewHolder {
|
||||||
final View mView;
|
final View mView;
|
||||||
final TextView mIdView;
|
final TextView mIdView;
|
||||||
final ImageView mAlarmView;
|
final ImageView mIconView;
|
||||||
final TextView mCycleView;
|
final TextView mCycleView;
|
||||||
final TextView mTitleView;
|
final TextView mTitleView;
|
||||||
Task mItem;
|
Task mItem;
|
||||||
@@ -143,7 +147,7 @@ public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerVi
|
|||||||
mView = view;
|
mView = view;
|
||||||
|
|
||||||
mIdView = view.findViewById(R.id.task_id);
|
mIdView = view.findViewById(R.id.task_id);
|
||||||
mAlarmView = view.findViewById(R.id.task_alarm);
|
mIconView = view.findViewById(R.id.task_icon);
|
||||||
mCycleView = view.findViewById(R.id.task_cycle);
|
mCycleView = view.findViewById(R.id.task_cycle);
|
||||||
mTitleView = view.findViewById(R.id.task_name);
|
mTitleView = view.findViewById(R.id.task_name);
|
||||||
}
|
}
|
||||||
|
@@ -96,6 +96,14 @@ public class Task {
|
|||||||
return dueDate;
|
return dueDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getDeleted() {
|
||||||
|
return deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDone() {
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
public void setTodayDate(String todayDate) {
|
public void setTodayDate(String todayDate) {
|
||||||
try {
|
try {
|
||||||
this.todayDate = LocalDate.parse(todayDate);
|
this.todayDate = LocalDate.parse(todayDate);
|
||||||
@@ -114,4 +122,5 @@ public class Task {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -104,6 +104,8 @@ public class TaskDataAccess implements AutoCloseable {
|
|||||||
task.setName(cursor.getString(1));
|
task.setName(cursor.getString(1));
|
||||||
task.setTodayDate(cursor.getString(2));
|
task.setTodayDate(cursor.getString(2));
|
||||||
task.setTaskListName(cursor.getString(3));
|
task.setTaskListName(cursor.getString(3));
|
||||||
|
task.setDone(cursor.getInt(5));
|
||||||
|
task.setDeleted(cursor.getInt(6));
|
||||||
tasks.add(task);
|
tasks.add(task);
|
||||||
cursor.moveToNext();
|
cursor.moveToNext();
|
||||||
}
|
}
|
||||||
|
BIN
app/src/main/res/drawable-hdpi/ic_check_ligth.png
Normal file
After Width: | Height: | Size: 324 B |
BIN
app/src/main/res/drawable-hdpi/ic_close_light.png
Normal file
After Width: | Height: | Size: 372 B |
BIN
app/src/main/res/drawable-mdpi/ic_check_ligth.png
Normal file
After Width: | Height: | Size: 208 B |
BIN
app/src/main/res/drawable-mdpi/ic_close_light.png
Normal file
After Width: | Height: | Size: 257 B |
BIN
app/src/main/res/drawable-xhdpi/ic_check_ligth.png
Normal file
After Width: | Height: | Size: 305 B |
BIN
app/src/main/res/drawable-xhdpi/ic_close_light.png
Normal file
After Width: | Height: | Size: 406 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_check_ligth.png
Normal file
After Width: | Height: | Size: 506 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_close_light.png
Normal file
After Width: | Height: | Size: 663 B |
@@ -18,7 +18,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/task_alarm"
|
android:id="@+id/task_icon"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/task_alarm"
|
android:id="@+id/task_icon"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
|