Size of Android notifications and small images

I'm trying to figure out what image size is used for notifications in ICS +
As shown here:
enter image description here

I tried setting ic_launcher , but it was too large and apparently was cropped in the image. (48 dp for MDPI) So now I use ic_stat_notify , which is 24dp for MDPI, and it looks pretty small.
I looked through all the documentation and I could not find mention of these icon sizes.

thanks

+6
source share
3 answers

More information about these icon sizes can be found in the "Iconography" section of the documentation here.

You can use this site to calculate exact sizes.

+2
source

If you implement your presentation through an xml layout, you can always scale the ImageView to a specific size.

From Android: Resizing an image in XML is shown in the following example:

 <ImageView [...] android:maxWidth="42dp" android:maxHeight="42dp" android:scaleType="fitCenter" android:adjustViewBounds="true" /> 
+1
source

You can create a custom notification using RemoteViews, and then in this custom notification layout you can add ImageView. Set the source of this ImageView to ic_launcher.png or something else. Now set the height and width from the layout / xml file to suit your requirements.

0
source

Source: https://habr.com/ru/post/959095/


All Articles