diff --git a/app/src/main/kotlin/cn/super12138/todo/views/todo/ToDoFragment.kt b/app/src/main/kotlin/cn/super12138/todo/views/todo/ToDoFragment.kt index 7358376..2669830 100644 --- a/app/src/main/kotlin/cn/super12138/todo/views/todo/ToDoFragment.kt +++ b/app/src/main/kotlin/cn/super12138/todo/views/todo/ToDoFragment.kt @@ -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)