/KotlinViewConstructor.kt Secret
Created
January 29, 2019 01:43
Kotlin shortcut for creating all three view constructors with a statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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