Created
April 19, 2017 08:00
-
-
Save brescia123/432306acf981829e5d0a226dd9163bb5 to your computer and use it in GitHub Desktop.
Kotlin useful extension functions for Android
This file contains 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
@ColorInt fun Context.color(@ColorRes id: Int, theme: Resources.Theme? = getTheme()): Int = | |
if (Build.VERSION.SDK_INT >= 23) | |
resources.getColor(id, theme) | |
else | |
resources.getColor(id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment