Android icon generator for actionbar and notificat

2019-01-31 23:23发布

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

8条回答
霸刀☆藐视天下
2楼-- · 2019-01-31 23:36

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;
查看更多
我只想做你的唯一
3楼-- · 2019-01-31 23:43

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

查看更多
狗以群分
4楼-- · 2019-01-31 23:43

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

查看更多
我想做一个坏孩纸
5楼-- · 2019-01-31 23:45

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.

查看更多
老娘就宠你
6楼-- · 2019-01-31 23:47

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.

查看更多
混吃等死
7楼-- · 2019-01-31 23:53

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

查看更多
登录 后发表回答