Fix fab hide when list empty
This commit is contained in:
parent
74761c8000
commit
60b23f1cf4
1 changed files with 3 additions and 0 deletions
|
|
@ -160,6 +160,9 @@ class ToDoFragment : Fragment() {
|
|||
binding.todoList.visibility = View.VISIBLE
|
||||
binding.emptyTip.visibility = View.GONE
|
||||
}
|
||||
if (todoList.size == 0 && !binding.addItem.isShown) {
|
||||
binding.addItem.show()
|
||||
}
|
||||
})
|
||||
todoViewModel.refreshData.observe(viewLifecycleOwner, Observer {
|
||||
binding.todoList.adapter?.notifyItemInserted(todoList.size + 1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue