Skip to content

Instantly share code, notes, and snippets.

@Kolyall
Created November 27, 2018 05:44
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 Kolyall/7c481f8d3c0f2d27e905362dfaf5b10e to your computer and use it in GitHub Desktop.
Save Kolyall/7c481f8d3c0f2d27e905362dfaf5b10e to your computer and use it in GitHub Desktop.
Add svg image to textView with selector

Add svg image to textView with selector

Drawable drawable = ContextCompat.getDrawable(this, R.drawable.ic_arrow_down_small).mutate();
ColorStateList colours = getResources().getColorStateList(R.color.arrow_down_selector);
Drawable drawableCompat = DrawableCompat.wrap(drawable);
DrawableCompat.setTintList(drawableCompat, colours);
titleView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawableCompat , null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment