mirror of
https://github.com/wismna/DoNext.git
synced 2025-10-03 15:40:14 -04:00
Prepare for Restore button
This commit is contained in:
@@ -135,6 +135,10 @@ public class Task {
|
||||
return todayDate != null && todayDate.isEqual(LocalDate.now());
|
||||
}
|
||||
|
||||
public boolean isHistory () {
|
||||
return getDone() == 1 || getDeleted() == 1;
|
||||
}
|
||||
|
||||
// Will be used by the ArrayAdapter in the ListView
|
||||
@NonNull
|
||||
@Override
|
||||
|
@@ -66,7 +66,7 @@ public class TaskFormDialogFragment extends DynamicDialogFragment {
|
||||
mButtonCount = args.getInt("button_count");
|
||||
mPositiveButtonString = getString(R.string.new_task_save);
|
||||
mNegativeButtonString = getString(R.string.new_task_cancel);
|
||||
mNeutralButtonString = getString(R.string.new_task_delete);
|
||||
mNeutralButtonString = getString(mTask.isHistory() ? R.string.new_task_restore : R.string.new_task_delete);
|
||||
listId = args.getInt("list");
|
||||
isToday = args.getBoolean("today");
|
||||
}
|
||||
|
@@ -69,4 +69,5 @@
|
||||
<string name="today_no_tasks">Rien à faire aujourd\'hui</string>
|
||||
<string name="create_tasks">Créez-en une là</string>
|
||||
<string name="today_create_tasks">Ajoutez des tâches là</string>
|
||||
<string name="new_task_restore">Restaurer</string>
|
||||
</resources>
|
@@ -34,6 +34,7 @@
|
||||
<string name="new_task_save">Save</string>
|
||||
<string name="new_task_cancel">Cancel</string>
|
||||
<string name="new_task_delete">Delete</string>
|
||||
<string name="new_task_restore">Restore</string>
|
||||
|
||||
<!-- Strings related to task details activity -->
|
||||
<string name="task_no_tasks">No tasks here!</string>
|
||||
|
Reference in New Issue
Block a user