Skip to content

Instantly share code, notes, and snippets.

@sliskiCode
Last active January 8, 2018 19:48
Show Gist options
  • Save sliskiCode/56ba32a32b39568c01543fe8bee73454 to your computer and use it in GitHub Desktop.
Save sliskiCode/56ba32a32b39568c01543fe8bee73454 to your computer and use it in GitHub Desktop.
6 magic sugars that can make your Kotlin codebase happier #30
fun toolbar(block: Toolbar.() -> Unit): Toolbar = Toolbar.apply(block)
object Toolbar {
fun openSearch(block: SearchToolbar.() -> Unit): SearchToolbar {
// Testing framework code
return SearchToolbar.apply(block)
}
}
object SearchToolbar {
fun type(text: String) {
// Testing framework code
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment