Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Icon Sizes [duplicate]

I know there are guidelines for creating icons for specific areas in Android (Tab, List, etc.) and how you would size them according to ldpi, mdpi, hdpi etc.

Are there any rules on how to scale other in-app icons?

I've got a 'tiny' icon of 10x10 px which I am using on my mdpi dev phone, what would be the scaling rules to create ldpi, hdpi & xhdpi versions of that icon?

Thanks

Dave

like image 444
DaveSav Avatar asked Aug 24 '12 21:08

DaveSav


People also ask

How do I reset icon size?

To resize desktop icons, right-click (or press and hold) the desktop, point to View, then select Large icons, Medium icons, or Small icons.

Is Android roundIcon required?

You must only use the android:roundIcon attribute if you require a different icon asset for circular masks, if for example the branding of your logo relies on a circular shape.


4 Answers

I would create separate images for each one:

Res     Px     
ldpi    36 x 36
mdpi    48 x 48
hdpi    72 x 72
xhdpi   96 x 96
xxhdpi  144x144
xxxhdpi 192x192

Then just put each of them in the separate stalks of the drawable folder.

like image 89
Gajendra Rawat Avatar answered Oct 04 '22 00:10

Gajendra Rawat


The ratios are .75|1|1.33|1.5|2.|3.|4. (or 3:4:6:8:12:16) That is, for your 10x10px bitmap, the graphics would be

ldpi    - 10x10 * 0.75 = 7x7
mdpi    - 10x10 * 1    = 10x10
tvdpi   - 10x10 * 1.33 = 13x13
hdpi    - 10x10 * 1.5  = 15x15
xhdpi   - 10x10 * 2    = 20x20
xxhdpi  - 10x10 * 3    = 30x30
xxxhdpi - 10x10 * 4    = 40x40
like image 31
DeeV Avatar answered Oct 03 '22 22:10

DeeV


Generalized rule for pixel values to support multiple screen is based on a baseline configuration of your device screen density. Baseline for density 160 pixels , mdpi comes in this range. So by calculating dpi values you can put these values in different dimens.xml to support various devices. General formula is :

Result = Value(dpi) * device density(pi)/160(dpi)

So first check your device density first then according to above formula calculate the values for dimens.xml. For standard we generally assume that:

For mdpi density = 160, hdpi - 240, xhdpi - 320 , ldpi - 120

As in your case if value is 10*10 then the Result for different screen will be :

For ldpi:

Result = 10*120/160 = 7.5 , i.e 7 pixels

For mdpi:

Result = 10*160/160 = 10 pixels

For hdpi:

Result = 10*240/160 = 15 pixels

For xhdpi:

Result = 10*320/160 = 20 pixels

You can also refer to this http://developer.android.com/guide/practices/screens_support.html and http://developer.android.com/training/multiscreen/screendensities.html

like image 36
Yash Avatar answered Oct 03 '22 22:10

Yash


According to the Android-Iconography guide, the icons should follow 2:3:4:6 scale ratios for different screen densities, medium, high, x-high, and xx-high respectively.

enter image description here

You can also check Android Design guide for iconography. http://developer.android.com/design/style/iconography.html

like image 34
Aksel Fatih Avatar answered Oct 04 '22 00:10

Aksel Fatih