Skip to content

Instantly share code, notes, and snippets.

@sliskiCode
Created November 23, 2016 14:00
Show Gist options
  • Save sliskiCode/798984eff02ee6ae2ce82c61902fb703 to your computer and use it in GitHub Desktop.
Save sliskiCode/798984eff02ee6ae2ce82c61902fb703 to your computer and use it in GitHub Desktop.
7 things you probably don’t know about Kotlin #4
// Using in Java
CustomButton button = new CustomButton(context);
button.setVisibility(CustomButton.Visibility.getGONE());
...
class CustomButton(context: Context?) : View(context) {
companion object Visibility {
val GONE = 1
val VISIBLE = 2
val INVISIBLE = 3
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment