distriqt/ANE-CustomResources

Why icons must be greyscale for Android?

Closed this issue · 2 comments

I've used to compile the freshplanet Push ANE with my colourful icons.
I've copied icon files into res directory drawable-xhdpi with correct names.

The actual code, that's probably is very similar to how it's implemented in your ANEs is:

// Notification images
        int smallIconId = Resources.getResourseIdByName(_context.getPackageName(), "drawable", "status_icon");
        int largeIconId = Resources.getResourseIdByName(_context.getPackageName(), "drawable", "app_icon");

So my guess is as long as directory structure , naming and image size stays the same I can use my colourful icons.

Also, the generated directory has subdirs like "drawable-mdpi-v11" and "drawable-mdpi". Is duplicate "drawable-mdpi-v11" really required when compiling custom resources?

Android notification icons must be grayscale on Android 5+. This is an Android requirement and nothing to do with the ANE. The status bar where they are displayed uses the white/grey icons. Check the Android design guidelines for info:

https://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html

If you need coloured icons in the notification area you can use the large icon to display an image. This doesn't need to be an Android resource.

Cheers

Thanks!