Skip to content

Instantly share code, notes, and snippets.

@sliskiCode
Last active December 5, 2016 08:58
Show Gist options
  • Save sliskiCode/5912a883cad502230df9aef903194ca4 to your computer and use it in GitHub Desktop.
Save sliskiCode/5912a883cad502230df9aef903194ca4 to your computer and use it in GitHub Desktop.
5 things you probably don’t know about Kotlin #5
val button = CustomButton(context)
button.visibility = CustomButton.Visibility.VISIBLE
button.foregroundGravity = CustomButton.ForegroundGravity.LEFT
class CustomButton(context: Context?) : View(context) {
companion object Visibility {
val VISIBLE = 1
val INVISIBLE = 2
}
companion object ForegroundGravity {
val LEFT = 1
val RIGHT = 2
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment