6

I managed to clone the git repository of Material Design icons, but now I'm struggling with how to use it.

I want to use the icon resources in the XML files, in the XML attributes like android:icon="@drawable/***.

so I searched quite many articles and none of them seems to be clear so far. Can someone explain?

MarshallLee
  • 1,290
  • 4
  • 23
  • 42

3 Answers3

30

You don't need to clone the repository to do this. If you're using an up to date version of Android Studio you can import the individual icons you need directly.

Right-click on your drawable folder and in the menu go to New > Vector Asset. From there the default option is to select any of the Material icons to use, or you have the option to use your own SVG files.

Lewis McGeary
  • 7,692
  • 2
  • 40
  • 46
4

In your project directory there's a drawable folder, the path should be: /app/src/main/res/drawable your icons have to be put in that folder in order to be used with @drawable/ command in XML.

Here a similar question, and here the link to the android drawable importer

Community
  • 1
  • 1
Marco
  • 705
  • 8
  • 28
0

You need to import the drawables into your project - the android drawable importer plugin is really useful for this

ligi
  • 39,001
  • 44
  • 144
  • 244