Created
January 25, 2018 23:19
-
-
Save umarov/c95cf3a50080bd7484f0c93d48723e83 to your computer and use it in GitHub Desktop.
TodoListDetailAdapter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TodoListDetailAdapter( | |
val context: Context, | |
inline val onTodoItemAction: (todoItem: TodoItem, actionType: Int) -> Unit) { | |
fun createTodoItem(todoItem: TodoItem) { | |
onTodoItemAction(todoItem, TodoItem.CREATE) | |
} | |
fun updateTodoItem(todoItem: TodoItem) { | |
onTodoItemAction(todoItem, TodoItem.UPDATE) | |
} | |
fun deleteTodoItem(todoItem: TodoItem) { | |
onTodoItemAction(todoItem, TodoItem.DELETE) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment