Add sample todo when creating account

This commit is contained in:
Phillip Thelen 2018-11-07 16:17:14 +01:00
parent a0c5e6626d
commit 85ca0bcc18
2 changed files with 5 additions and 1 deletions

View file

@ -833,4 +833,6 @@
<string name="verification_pet">One of these Veteran Pets will be waiting for you after youve finished confirming!</string>
<string name="welcomeNameTitle">What should we call you?</string>
<string name="display_name_length_error">Display names must be between 1 and 30 characters</string>
<string name="setup_task_join_habitica">Join Habitica (Check me off!)</string>
<string name="setup_task_join_habitica_notes">You can either complete this To-Do, edit it, or remove it.</string>
</resources>

View file

@ -119,12 +119,14 @@ class TaskSetupFragment : BaseFragment() {
tasks.add(taskObject)
}
}
tasks.add(makeTaskObject(Task.TYPE_TODO, getString(R.string.setup_task_join_habitica), null, null, getString(R.string.setup_task_join_habitica_notes)))
return tasks
}
private fun makeTaskObject(type: String?, text: String?, up: Boolean?, down: Boolean?): Task {
private fun makeTaskObject(type: String?, text: String?, up: Boolean?, down: Boolean?, notes: String? = null): Task {
val task = Task()
task.text = text ?: ""
task.notes = notes
task.priority = 1.0f
task.type = type ?: ""