mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-05 19:21:04 +02:00
tweaking some things about checklist item removal
This commit is contained in:
parent
e9b5efa2ce
commit
74cdea8cfb
@ -129,8 +129,6 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
|
|
||||||
saveNote()
|
saveNote()
|
||||||
setupAdapter()
|
setupAdapter()
|
||||||
|
|
||||||
(view.checklist_list.adapter as? ChecklistAdapter)?.notifyDataSetChanged()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,14 +171,13 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun removeDoneItems() {
|
fun removeDoneItems() {
|
||||||
items.removeIf { it.isDone }
|
items = items.filter { !it.isDone }.toMutableList() as ArrayList<ChecklistItem>
|
||||||
updateUIVisibility()
|
|
||||||
view.checklist_list.adapter?.notifyDataSetChanged()
|
|
||||||
saveNote()
|
saveNote()
|
||||||
|
setupAdapter()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateUIVisibility() {
|
private fun updateUIVisibility() {
|
||||||
with(view) {
|
view.apply {
|
||||||
fragment_placeholder.beVisibleIf(items.isEmpty())
|
fragment_placeholder.beVisibleIf(items.isEmpty())
|
||||||
fragment_placeholder_2.beVisibleIf(items.isEmpty())
|
fragment_placeholder_2.beVisibleIf(items.isEmpty())
|
||||||
checklist_list.beVisibleIf(items.isNotEmpty())
|
checklist_list.beVisibleIf(items.isNotEmpty())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user