Last active
August 14, 2018 11:18
-
-
Save danielgomezrico/3ac2317c04ee2e60dc50 to your computer and use it in GitHub Desktop.
Android / Kotlin - Typedef Annotations example
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
import android.support.annotation.IntDef | |
import kotlin.annotation.AnnotationRetention | |
class MyClass { | |
companion object { | |
const val ITEM_SERVICES = 0L | |
const val ITEM_PORTFOLIO = 1L | |
} | |
@IntDef(ITEM_SERVICES, ITEM_PORTFOLIO) | |
@Retention(AnnotationRetention.SOURCE) | |
annotation class ITEM | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to call it in the implementation class ?