Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Last active May 13, 2021 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorbrndls/3f0b031ed5a6cda4aae2f9376618699a to your computer and use it in GitHub Desktop.
Save victorbrndls/3f0b031ed5a6cda4aae2f9376618699a to your computer and use it in GitHub Desktop.
fun Context.getCompatColor(@ColorRes colorId: Int) = ResourcesCompat.getColor(resources, colorId, null)
fun Context.getCompatDrawable(@DrawableRes drawableId: Int) = AppCompatResources.getDrawable(this, drawableId)!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment