SagiLow
SagiLow

Reputation: 6029

Android notification small and big images sizes

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

I've tried setting the ic_launcher but it was too big and appear to be cut on the image. (48dp for MDPI) So now i'm using ic_stat_notify which is 24dp for MDPI and it looks pretty small.
I went through all the documentation and I couldn't find any mention of these icons size.

Thank you

Upvotes: 7

Views: 6447

Answers (3)

Sachin Parashar
Sachin Parashar

Reputation: 1116

You can create a custom notification using RemoteViews and then, in that custom notification's layout, you can add an 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 as per your requirements.

Upvotes: 0

Mark N
Mark N

Reputation: 336

If you are implementing your view through a xml layout, you can always scale the ImageView to fit a specific size.

From Android: resizing imageview in XML comes the following example:

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

Upvotes: 1

Aurelian Cotuna
Aurelian Cotuna

Reputation: 3081

You can find more about these icons dimensions in Iconography part of the documentation here

You can use this website in order to calculate the exact dimensions

Upvotes: 2

Related Questions