Skip to content

Instantly share code, notes, and snippets.

@sidgrio
Created January 29, 2019 01:43
Kotlin shortcut for creating all three view constructors with a statement
class FancyCustomView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : View(context, attrs, defStyleAttr) {
// Logic for custom view
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment