Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
withBeforeAfter(
before = {
binding.recyclerView.isLayoutFrozen = true
},
after = {
binding.recyclerView.isLayoutFrozen = false
},
block = {
// complex processing
}
)
inline fun withBeforeAfter(
before: () -> Unit,
after: () -> Unit,
block: () -> Unit
) {
before()
block()
after()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment