27

I found this Asset Studio to generate icons. It works fine for the launcher icon but for action bar or notification icons it is not working. I put in my png file and want to generate the icons, but Asset Studio is only generating gray circles. Is there another tool to generate action bar and notification icons?

enter image description here

Sandeep R
  • 2,193
  • 3
  • 22
  • 50
Mulgard
  • 8,305
  • 26
  • 110
  • 205

8 Answers8

38

You can use a tool for creating generic icons in Asset Studio: https://romannurik.github.io/AndroidAssetStudio/icons-generic.html. To get it look like ActionBar Icon, you should make next actions:

  1. Choose image
  2. The size of image should stay at 24dip
  3. Change padding to 4dip
  4. Move foreground color thumb to 0%
  5. That's it! Download .zip now.

The sizes of icons will be pretty the same as you can get them with ActionBar Icon Generator.

How it looks for me: icon generator screenshot

romtsn
  • 10,584
  • 2
  • 25
  • 47
4

I think it's because your image is too complexe and the main problem is the "color" filter applied in AAS.

I had the same problem and I had to convert xxxhdpi xxhdpi etc. manually. If you work with Sketch (for example) it can be converted easily with a plugin (https://github.com/zmalltalker/sketch-android-assets)

hope it's help !

If you want to use AAR, like @rom4ek explained "4. Move foreground color thumb to 0%" this is the important part

koni
  • 1,745
  • 1
  • 12
  • 13
1

I use an own module 'icons' with a Gradle script to generate icons. This is a more automated way than the Assets Studio can provide up-to-now. The icon will be designed with Inkscape. See my blog for a detailed description. You find an Android Studio Project on GitHub.

1

after alot of search this is the solution: the problem is you are adding an image with white background.. to convert the image to actionbar icon you have to load image with transparent background

Alaa AlDarf
  • 71
  • 2
  • 3
0

You can use the built in feature of android studio to generate actionbar and notification icons.

Right click on res folder and New > Image Asset. You can choose Launcher Icons, Action Bar Icons or Notification Icons in the Asset Type.

Update: You should look at this. It talks about white icon in notification.

Community
  • 1
  • 1
Samir
  • 3,081
  • 2
  • 12
  • 22
  • 1
    even that is generating the same output as shown in the question. I think it has something to do with the image format. – Sandeep R Jul 02 '15 at 07:53
0

I face the same problem their is no issue with icon after Lollipop notification icon do not contains color icon it support flat,Silhouette icon supported.

  • Either you can change target SDK to 20
  • Or generate flat icon(icons8 is best option)

Or

you should use a condition

  boolean useWhiteIcon = (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP);
    return useWhiteIcon ? R.drawable.icon_silhouette : R.drawable.ic_launcher;
Rajesh Tiwari
  • 381
  • 4
  • 21
  • Do not listen to this answer about setting target SDK to 20. See this question: http://stackoverflow.com/questions/28387602/notification-bar-icon-turns-white-in-android-5-lollipop – boltup_im_coding Oct 06 '16 at 07:01
  • Please read post carefully i mention two points which ever is best you can use it. I also no setting up target sdk to 20 is not best option – Rajesh Tiwari Oct 07 '16 at 07:09
-1

Android Studios 2.2 has an Image Asset Studio that you can use to generate your icons.

https://developer.android.com/studio/write/image-asset-studio.html

Simon
  • 18,312
  • 22
  • 130
  • 197
-5

By default it will be grey color for any image. But you can customize it according to your color. Check below screenshot to select CUSTOM tab and then select color you want.

enter image description here

Hope it helps you.

virendrao
  • 1,552
  • 2
  • 19
  • 35