Map Material design icon to Drawable folder in Android application - android

Google has released a set of icons for Material design. However each folder like drawable-xhdpi in this has 4 different sizes of each icon. If some one wants to use them in his/her android application which one to use for each density type
drawable-hdpi
drawable-xhdpi
drawable-xxhdpi
drawable-xxxhdpi
Can anybody help me which icons to use here?
Thanks

This is determined by the type of icon you need. The developers guide says about iconography that for example notification icons should be 24dp, action bar icons 32dp, small icons 16dp and so on.

Related

Sizes of an image to put as action bar

In my app I put an image as actionbar
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.header_edea));
The code is right, but I need the sizes for the different densities (ldpi, hdpi, etc).
Check the following link:
Design layout to support multiple screen
on Android Studio, you can choose an image for different layout sizes.for example, you add that image on Project -> new -> ImageAsset and it will show you or it will create that image for different sizes with different directories.(you can see the results in different drawable folders or mipmap folder with different sizes).
And after that, you just have to choose it and it will fix that for different sizes.
Android Studio has already a tool called Asset Studio described in LinX64.
For this purpose you can also check an online tool created by Roman Nurik called Android Asset Studio, which helps you to generate all needed image sizes: https://romannurik.github.io/AndroidAssetStudio/
Check this links - the first is a guide about creating icons, the second one give you information about all needed icon sizes for Android purposes like notifications or action bar:
Google's Design -
Icons
Icon Reference
Chart
Also on StackOverlow:
Action Bar icon size
Actionbar Logo size?
Hope it help

How to clarify what my apps icons are - Android

I have 2 questions,
Okay so I have read online what sizes I should make my app icons for certain size phone screens. I know how to clarify what the launcher Icon is for my app with this code,
android:icon="#drawable/icon"
My app image is 72px x 72px. So its placed in the drawable-hdpi folder. Then I have a 36px x 36px icon for low density screens which is placed in the drawable-ldpi folder. So, for the 36px x 36px icon, should it be saved in the drawable-ldpi folder as icon? Cause wouldn't this cause an error because 2 files will be named the same thing?
Second question is my app launcher icon is saved in the drawable-hdpi folder. I read online that I also need an action bar and status bar icon, both have to be 36px x 36px. Where do I save these files at? In the drawable-hdpi file for high resolution screens I assume, but what do I name them? Do I have to clarify them in the android manifest file? How do I do so?
It would be better if you forget px when talking about Android drawables and think in dp instead. Launcher icon is 48x48dp, so (48px on mdpi, 72px on hdpi, etc.)
So, for the 36px x 36px icon, should it be saved in the drawable-ldpi folder as icon?
Yes.
Cause wouldn't this cause an error because 2 files will be named the same thing?
No. Android nicely handles same resource for different configurations even if you have folder with name drawable-large-land-fr-xhdpi or something like this. It tries to take the best match from its configuration.
I read online that I also need an action bar and status bar icon, both have to be 36px x 36px.
It's always good to provide source, which seems to be giving false statements. You can read on Android Developers that action bar icons have to be 32x32dp and notification 24x24dp. And you don't need them if you don't use them.
Where do I save these files at? In the drawable-hdpi file for high resolution screens I assume, but what do I name them?
You can name them anything you like (you don't need to name your app icon as icon.png).
Do I have to clarify them in the android manifest file?
No. You put them when you use them. For action bar icons that would probably be in menu.xml.

Actionbar Icon are bigger than actionbar and are cropped

I am using the sherlock's actionbar for my application. I am facing the weird issue in which in Samsung Note2, the icons on action bar are displayed bigger than the actionbar and are cropped.
On the galaxy ace, everything works perfectly.
How can this be solved?
Do you have just one version in a drawable folder? If so, try putting different size images (18x18, 24x24, 36x36, 48x48) in the drawable-ldpi, drawable-mdpi, drawable-hdpi, drawable-xhdpi folders instead. Android will automatically select the right size image to use depending on the density.
I would suggest you to use some icons for action bar
http://developer.android.com/design/style/iconography.html#action-bar
They will give you the exact size of icons you need for all screen resolutions and you wont face any problem.
In case you have your own icons, you can just keep the icons from icon pack as a guide for the size.

Notification Icons shrunk to 36x36 for xhdpi

I have a drawable-xhdpi-v11 folder containing a 48x48 icon which is used in my Notification:
Notification notification = new Notification(R.drawable.ic_not_logo, null, now);
I noticed on my Galaxy Nexus running JB, the icon is shrunk to 36x36, making it blurry. Why does the documentation ask for a 48x48 if it wants a 36x36? Am I missing something? Is there a way to make my notification icons pixel perfect?
EDIT:
Here is a related post
Android status bar expects icons of size 25x25dp while guidelines recommend 32x32dp. Who is wrong?
The answers in this post do not explain why it still asks for a 48x48 sized icon and down scales it to 36x36.
You should provide different version of the very same resource.
Follow the guide: android design status bar
My final conclusion is that it is impossible to have pixel perfect Notification Icons. I experimented with providing different sized icons to the drawable-xhdpi-v11 folder and it down-scales all icons provided regardless of their size, leading to a loss in resolution and blurriness of pixel perfect icons. Pretty disappointing.
You should definitely stick to the 24dp value from the guidelines, but you must provide an xxhdpi res (72px) which can then be used by Android to scale to 36px without blur. Same with app icons, some tablets use the xxhdpi res for the homescreen, even though the device is xhdpi.

Android menu icon smaller in honeycomb

I've created a menu icon and included a 36x36, 48x48 and 72x72 in the ldpi, mdpi and hdpi drawable folders. It looks fine on all devices except honeycomb tablets, where it seems like the padding around the Android icons are bigger than on my custom icon. I've included a screenshot (see how much bigger my 'Resume Reading' icon is than the android 'Back' and 'My Library' icons are). How do I make my icon look like this?
I think I found the problem. When using the Android resource icon's on a tablet, I think it changes the padding in order for the icon to be used in the action bar. So when displaying them in a pop up menu at the bottom they are appearing much smaller than they should be. The solution is to copy the android resources into our own resource folder as it says to do here http://developer.android.com/guide/practices/ui_guidelines/icon_design_menu.html
Most of your Tablets are not hdpi, they are xhdpi. While the Icon Design Guidelines are useful, they don't give the whole story. Consider reading Supporting Multiple Screens. Here, they tell you further ratios and dimensions. To save you some time, resources should be 3ldpi:4mdpi:6hdpi:8xhdpi meaning that your xhdpi icon should be 96 x 96. Please, read the whole document, though. It is insanely useful.

Categories

Resources