Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

notification icon gets cropped

I use notification in my app and I have problem with the icon of the notifications. The problem is that when the notification received with the text the icon gets cropped and it looks very bad. after the ticker ends the icon looks fine. I added a image with how it's look when the notification arriving and after the ticker is finished. the upper image is the icon when the notification arrived

I can't use notificationCompat because my app needs to support api level 8. how can I fix this problem without changing the size of the icon to 36X36 px? this problem only happens in nexus 4 and htc one, in all of the samsung devices i checked (s2 4.1.2, s2 4.0.3, s3 4.1.2, s4 4.2.2, galaxy y) it works fine.

thanks in advanace

Edit:

I managed to make the notification not to be cropped. BUT! when I add ticker Text (which is something I must add) the notification gets cropped again. What could make that happen?

like image 337
Shalom Melamed Avatar asked Sep 17 '13 18:09

Shalom Melamed


People also ask

Can notification icons change?

1 Tap Notification Settings on the notification panel or tap the Settings app. 2 Tap Notifications. 3 Tap App icon badges.

How do I change the shape of a notification?

Start by opening the Settings application. Navigate to Personalisations > Notification Drawer. Here, select a shape from the list of options available at the bottom of your screen.


1 Answers

notification icon must be 24x24 dp for optimal solution on most devices.

see

http://developer.android.com/design/style/iconography.html#notification

or create the following notification sizes:

  • 96x96px in drawable-xxxhdpi

  • 72x72px size in drawable-xxhdpi

  • 48x48px in drawable-xhdpi

  • 36x36px in drawable-hdpi

  • 24x24px in drawable-mdpi

  • 18x18px in drawable-ldpi

also it better to centerized your icon in the middle of the icon image with transparent space around it.

Google has updated their icon design page, here is another link that shows the optimum icon sizes for you app resources.

http://www.creativepulse.gr/en/blog/2014/icon-sizes-for-android-apps

like image 60
moh.sukhni Avatar answered Oct 23 '22 09:10

moh.sukhni