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.
Related
What is the correct size to choose for Vector Drawable icons e.g. when importing them from SVG?
There is a lot of information about standard icon dimensions for raster icons, for example this site. However, I'm a little bit struggling to get icons imported from SVG appear normally, I'm basically determining them by trial and error.
Particularly interested in launcher and notification icon sizes. I've currently settled on 192x192 for launcher icons and 48x48 for notification icons.
Using a smaller size for launcher icons results in a blurred icon on my KitKat tablet and using a larger size looks bad as well.
But the notification icon still appears larger than in other apps so it should probably be something like 32x32.
You choose what is the best, what it depends on is the version of Android, the default is 24x24 dp
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.
Here is my setup. Two tablets - 7" and 21". The smaller tablet has a higher DPI.
Two png images. Both the images are 36x36. The first image is copied to drawable-ldpi directory and the second image is copied to drawable-mdpi directory. These images are displayed as menu items in the actionbar.
On 21" tablet, both the images are displayed with the same height. The framework leaves about 10% space on the top and on the bottom of the actionbar.
On 7" tablet, the first image appears bigger than the second image. The bottom of the first image aligns with the bottom of the actionbar.
I am trying to understand how the framework calculates the height of the final bitmap to be displayed. I am developing a custom view and need to do a similar calculation. Thank you in advance for your help.
Two png images. Both the images are 36x36. The first image is copied to drawable-ldpi directory and the second image is copied to drawable-mdpi directory.
First of all, you have to provide the same image with different sizes per device/screen size.
Then, you should create other folders, for instance drawable-large which will handle drawables for large screens like your tablets
Have a look here
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.
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.