Skip to content

Instantly share code, notes, and snippets.

@umarov
Created January 25, 2018 23:21
Show Gist options
  • Save umarov/648d3a7695ffb5e3d80a5355f0d28551 to your computer and use it in GitHub Desktop.
Save umarov/648d3a7695ffb5e3d80a5355f0d28551 to your computer and use it in GitHub Desktop.
fun onTodoItemAction(todoItem: TodoItem, actionType: Int) {
when (actionType) {
TodoItem.CREATE -> todoListDetailViewModel.createTodoItem(todoItem)
TodoItem.UPDATE -> todoListDetailViewModel.updateTodoItem(todoItem)
TodoItem.DELETE -> todoListDetailViewModel.deleteTodoItem(todoItem)
}
}
TodoListDetailAdapter(context, onTodoItemAction)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment