I created an image in a 96x96 size, gave padding of 4px on all sides following this information.
Then I used Android Asset Studio to generate icons for different screens. But when I used these in my Notification Builder it is showing a grey box. Where am I doing wrong?
This is my image. Unable to display it here as background is transparent and image is white in color. Please download to see it.
I have the same problem. all my colors are white over transparent png, i still get plain white square on it. I checked the drawable folder have already generated 12 corresponding ic_stat_name.png file and they look as expected. But when i send notification the icon still appear white square.
I found the solution
Notification Icon with the new Firebase Cloud Messaging system
I use firebase notification which, according to the above source, will use the launcher icon instead of my expected ic_stat_name.png for notification
Related
I found a documentation from OneSignal saying that the icons must be white even, from API 21.
I was using Android Asset Studio previously. Images are being generated in white.
your "icon" have a rounded background, so it is also converted to white pixels... your notification icon should contain only image-shape, e.g. logo of app without background - put this image into Assest Studio and you will get proper icon (every non-transparent pixel will be converted to white)
for example: Facebook icon is small "f" letter on blue rounded-corner background - put only "f" icon on transparent background to get proper white icon in Asset Studio (well, in this case it is already white...)
As i know, if your app supports Android 2.3 to 2.3.7 (API level 9 to 10), Image Asset Studio generates a gray version of your icon. Later Android versions use the white icon that Image Asset Studio generates.
The way to generate the correct notification icon:
Use the ANDROID ASSET STUDIO. https://jgilfelt.github.io/AndroidAssetStudio/icons-launcher.html#foreground.type=image&foreground.space.trim=1&foreground.space.pad=-0.05&foreColor=e8eaf6%2C27&crop=1&backgroundShape=none&backColor=e8eaf6%2C100&effects=none&elevate=0
Download the icon which you want from the website. You could search icon in goole. It would show a lot of websites whicn could download.
I'm trying to implement a launcher icon for an Android app. I'm using Android Studio's New Image Asset capability to create the icon from an image file and it works in most places except for the later Pixels.
On the Pixel 3XL, it looks like the following figure. The icon with a round white border around it.
On the Pixel 2, it looks the same
But on an original Pixel, it looks right:
I created the icon assets using the Android Studio New Image Asset capability. Selecting the image icon as shown in the following figure:
Then I set the background to the background color for the icon:
Based on what the UI shows, the icons all look right and Android Studio is supposed to generate the right files for all target platforms. Can someone please help me understand what I need to do to get rid of that white border on later phones?
You should add ic_launcher_foreground.xml and ic_launcher_background.xml to drawable file in your project. As far as I get it, you've try to make red background then add red backgorund layout you have only foreground image in this way. Btw that is not a bug that is a feature :)
so I want to make icon for push notification. say for example I want to use the android image below as notification icon
https://p7.hiclipart.com/preview/135/689/279/android-computer-icons-logo-android.jpg
so I try to make it using Android asset studio. but the image generated from this Android Asset studio is completely white like this
what should I do ? is there any image requirement for this ?
Use Transparent Images
The icons generated will be totally solid color (dark grey or white will be used on the device depending on theme).
The icon you add should only contain the "shape" you want to show as the single color. The rest should be transparent pixels.
Any non-transparent pixels will be converted to white. So if you have a square logo with no transparent pixels, it will be a giant single colored square.
Use a .png image so you can save it with transparent background.
As you can see, icons in notifications bar are white, that's why you are seeing all white
I have tried built in tools in android studio using res -> new -> Image Asset and then selecting notification icon.But after selecting the images it shows some grey and black boxes and not image icon and doesn't show in notifications as well.
I have researched and found that image background should be transparent for it to work but that didn't work also. Also i have tried images of 24x24 size as recommended but couldn't get the icon working in my android app.
Thanks in advance for any useful suggestions.
For v21 and above--> In notification icon, only white and transparent colors are allowed. Use white color what u want to show, rest part make it transparent.
For v20 and below --> You can use any image with proper dimensions.
Refer here for details.
So I've been working with Android Notifications and after setting a large image, I found out that my small image is actually not displaying properly.
As you can see on the following screenshot of the lockscreen, the background of the small icon is transparent. I want to set a specific colour there, just like the one Outlook.com is using:
Another example where the small icon shows next to the large one (please take notice of the small icon which is actually displaying, but not really noticable because there is just no background):
I've been thinking about changing the small icon to include the background colour, but obviously the colour would also be shown in the statusbar and that's wrong.
Try setColor() with NotificationCompat.Builder to set the accent color, which should be used by the colored circle behind the icon.