Fixed the progress is not updated

This commit is contained in:
Super12138 2024-03-10 09:31:27 +08:00
parent a59d9a44a3
commit d8cd2cd822
2 changed files with 2 additions and 3 deletions

View file

@ -30,7 +30,6 @@ class AllTasksAdapter(private val todoList: MutableList<ToDo>,
holder.todoContext.text = todo.content holder.todoContext.text = todo.content
holder.todoSubject.text = todo.subject holder.todoSubject.text = todo.subject
holder.itemView.setOnClickListener { holder.itemView.setOnClickListener {
val infoBottomSheet = InfoBottomSheet.newInstance( val infoBottomSheet = InfoBottomSheet.newInstance(
todo.content, todo.content,

View file

@ -49,7 +49,6 @@ class ToDoAdapter(private val todoList: MutableList<ToDo>, private val viewModel
notifyItemRangeChanged(position, todoList.size) notifyItemRangeChanged(position, todoList.size)
todoViewModel.updateTask(todo.uuid) todoViewModel.updateTask(todo.uuid)
progressViewModel.updateProgress()
// 设置空项目提示可见性 // 设置空项目提示可见性
if (todoList.isEmpty()) { if (todoList.isEmpty()) {
@ -57,6 +56,7 @@ class ToDoAdapter(private val todoList: MutableList<ToDo>, private val viewModel
} else { } else {
todoViewModel.emptyTipVis.value = View.GONE todoViewModel.emptyTipVis.value = View.GONE
} }
progressViewModel.updateProgress()
} }
holder.delToDoBtn.setOnClickListener { holder.delToDoBtn.setOnClickListener {