0

I have downloaded the Material Design icons from here Material Design Icons. The icons are all in black. In my application, I would like to use the same icons in white.

What would be the way for changing the icon colours?

I am not able to use photo editing tools for changing the icon colour.

Update: I tried with android:tint but it did not work:

<item 
    android:id="@+id/menu_item"
    android:icon="@drawable/ic_add_circle_black_24dp"
    android:tint="#FFFFFFFF"
    app:showAsAction="always">
</item>
Amit
  • 519
  • 1
  • 5
  • 20

3 Answers3

2

You can also download them in white from the material design website. Material design web color selection

For tinting drawables you can use DrawableCompat.

Example from this question:

Drawable normalDrawable = getResources().getDrawable(R.drawable.drawable_to_tint);
Drawable wrapDrawable = DrawableCompat.wrap(normalDrawable);
DrawableCompat.setTint(wrapDrawable,getResources().getColor(R.color.colorPrimaryLight));
Community
  • 1
  • 1
LordRaydenMK
  • 13,074
  • 5
  • 50
  • 56
1

You can set in XML in the ImageView tag

anroid:tint="@color/your_color"

or in Java

imageView.setColorFilter(Color.RED);

You can read more about it on ImageView API

Iulian
  • 1,156
  • 11
  • 19
  • I tried with android:tint, but it didn't make any difference. Please see the update in the main description – Amit Nov 13 '15 at 10:58
0

You can download Google's Material Design icons from GitHub, where they come in black, grey and white. Or, there are a couple of plugins you can use for Android Studio that give you the option to apply a colour scheme: here is one of them

PPartisan
  • 8,173
  • 4
  • 29
  • 48