Last active
September 4, 2018 07:08
-
-
Save colinrtwhite/b3931a607650935da939c8d1ff667e9b to your computer and use it in GitHub Desktop.
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
@ColorInt fun Context.getColorCompat(@ColorRes colorRes: Int): Int { | |
return ContextCompat.getColor(this, colorRes) | |
} | |
fun Context.getDrawableCompat(@DrawableRes drawableRes: Int): Drawable { | |
return AppCompatResources.getDrawable(this, drawableRes)!! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment