Skip to content

Commit

Permalink
Fix fab hide when list empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Super12138 committed Jan 5, 2024
1 parent 74761c8 commit 60b23f1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 60b23f1

Please sign in to comment.