Skip to content

Instantly share code, notes, and snippets.

@sys1yagi
Created February 27, 2017 13:01
Show Gist options
  • Save sys1yagi/8236098d77627745e01adc06d4c554c2 to your computer and use it in GitHub Desktop.
Save sys1yagi/8236098d77627745e01adc06d4c554c2 to your computer and use it in GitHub Desktop.
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