change svg android drawable color
private void changeSearchDrawable() { Drawable drawable = ResourcesCompat.getDrawable(getResources(), R.drawable.icon_search, getTheme()); int colorVal; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { colorVal = this.getResources().getColor(R.color.nnnow_pink, getTheme()); } else { colorVal = this.getResources().getColor(R.color.nnnow_pink); } drawable.setColorFilter(colorVal, PorterDuff.Mode.SRC_ATOP); check.setImageDrawable(drawable); }
Comments
Post a Comment