mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
allow adding 3 checklist items at once
This commit is contained in:
@ -80,12 +80,17 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
||||
|
||||
private fun showNewItemDialog() {
|
||||
NewChecklistItemDialog(activity as SimpleActivity) {
|
||||
val currentMaxId = items.maxBy { it.id }?.id ?: 0
|
||||
val checklistItem = ChecklistItem(currentMaxId + 1, it, false)
|
||||
items.add(checklistItem)
|
||||
var currentMaxId = items.maxBy { it.id }?.id ?: 0
|
||||
it.forEach {
|
||||
val checklistItem = ChecklistItem(currentMaxId + 1, it, false)
|
||||
items.add(checklistItem)
|
||||
currentMaxId++
|
||||
}
|
||||
saveNote()
|
||||
if (items.size == 1) {
|
||||
setupAdapter()
|
||||
} else {
|
||||
(view.checklist_list.adapter as? ChecklistAdapter)?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user