I use notification in my app and I have problem with the icon of the notifications.
The problem is that when the notification received with the text the icon gets cropped and it looks very bad.
after the ticker ends the icon looks fine.
I added a image with how it's look when the notification arriving and after the ticker is finished.
I can't use notificationCompat because my app needs to support api level 8.
how can I fix this problem without changing the size of the icon to 36X36 px?
this problem only happens in nexus 4 and htc one, in all of the samsung devices i checked (s2 4.1.2, s2 4.0.3, s3 4.1.2, s4 4.2.2, galaxy y) it works fine.
thanks in advanace
Edit:
I managed to make the notification not to be cropped.
BUT! when I add ticker Text (which is something I must add) the notification gets cropped again.
What could make that happen?
notification icon must be 24x24 dp for optimal solution on most devices.
see
http://developer.android.com/design/style/iconography.html#notification
or create the following notification sizes:
96x96px in drawable-xxxhdpi
72x72px size in drawable-xxhdpi
48x48px in drawable-xhdpi
36x36px in drawable-hdpi
24x24px in drawable-mdpi
18x18px in drawable-ldpi
also it better to centerized your icon in the middle of the icon image with transparent space around it.
Google has updated their icon design page, here is another link that shows the optimum icon sizes for you app resources.
http://www.creativepulse.gr/en/blog/2014/icon-sizes-for-android-apps
If you're using Eclipse, you can create notification icon set via standard wizard.
Go to File->New->Other
Select Android->Android icon set
Select "Notification Icons" option, enter resource name and press "Next"
Choose "Image" for Foreground and browse for your icon file
Press "Finish"
The wizard will create a drawable resource which you will use in setSmallIcon(). I created my notification icons in such way, and it looked fine with the ticker.
Related
When you code on Android Studio there is a standard icon symbol ( green Android ). I know how to change it. When I go to manifests.xml and look at this line
android:icon="#mipmap/ic_launcher"
the icon launcher must be in the directory "mipmap". When I go to mipmap, there are several .png files of ic_launcher.
Such as
ic_launcher.png(hdpi)
ic_launcher.png(mdpi)
ic_launcher.png(xhdpi)
ic_launcher.png(xxhdpi)
ic_launcher.png(xxxhdpi)
The question now is which of these files do I have to replace in order to get a new custom icon? Thank you.
You should use the Image Asset wizard. This allows you to add an Image Launcher which is the kind of image for your App's logo
Image Asset Pop-up Menu
Image Asset will ensure all resolutions and sizes for the logo.
They are categorized according to the size of screen for example tablet users uses xxhdi ic_launcher.png and hdpi ic_launcher.png for small size screen like 3 inches screen. If you are developing cool apps then you need to resize your icons for all these mentions size otherwise you can make any size and call them in manifest.
All of them because each one of them means that the icon will be displayed on the device depending on the size of the screen that is "from the smallest to the largest".
A tip if you are going to use the same icon for each one, first create the bigger image and then reduce it, I think the same android studio is reduced when you use the option because of the icon I think you can call application icon.
The biggest image is 512, this is the image of the web that will be displayed in the Play Store
So I am generating an Android notification and setting the small icon property to an image that is 400x400 pixels. The image looks as it's supposed to in the notification bar (see below - it's the yellow circle with green/red outline thing).
The problem is that when you pull down the notification drawer, the image for the notification's small icon is zoomed in and doesn't look as it should (see image 2). I want it to be that exact same image as the icon in the notification drawer, too.
Does anyone know why this happens / how to make the original image be the actual small icon?? Please let me know :( thanks.
According the Guidelines :
Notification icons must be 24x24 dp.
400x400 px sounds a very big size, i use in some applications the launcher icons, even the xxhdpi (144x144) and xxxhdpi (192x192) will load with no problem.
I've got Android application running on Amazon Kindle Fire HD 8.9". It's got a full HD display with carousel home screen where icons are 675x675 px big.
First problem I had was using standard small app icons which are stretched and blurry on this device. I solved it by adding new folder
drawable-large-mdpi
into /res folder and adding 675x675 icon in here.
This works and app icon in carousel is nice, big and sharp.
Second problem is that this big icon appears also in the SettingsActivity which is based on PreferenceActivity (PreferenceScreen and PreferenceCategory used in layout xml).
So, my question is how to use different (small one) icon here?
I tried
android:icon
but that doesn't work. Anybody knows?
If you are sideloading/testing your .apk then it will only use the default small icon. If you deliver the app through the appstore then it will use the assets you specify in the developer portal for the launcher carousel
https://developer.amazon.com/post/Tx18I929G17TAAS/Submitting-Visual-Marketing-Assets-Marketing-Tip-of-the-Day-4.html
I am working on an app which is able to add shortcuts icons to the homescreen.
What is the correct icon size for Android tablets? (Or better said, how to get it at runtime?) It seems to differ from what is written on this page.
I have switch on DisplayMetrics.densityDpi and change the icon size accordingly. But it does not work for all devices..Gnex seems to be ok, but my Galaxy Tab while beeing DisplayMetrics.DENSITY_MEDIUM device displays only 48x48px icon (as it is in guidelines), but usual launcher icons are 72x72 pixels and not 48x48 - it differs from guidelines? Is it possible that it is related to TouchWiz UI and thus it differs from pure Android? Or where is the problem? Also good to note, that apps itself displays correct launcher icon (it takes the icon from hdpi folder), but at runtime it looks like it is mdpi device:/
Thanks
Android tablets looks one bucket up, when looking for launcher icon..That means mdpi device will actually look into hdpi folder..
This code returns correct size for launcher icons
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
int iconSize = am.getLauncherLargeIconSize();
Answer is based on this g+ post by Nick Butcher
best thing you use the android assets studio tool for this task .
it will automatically create the correct sizes and put them in the correct folders .
I followed the icon design guidelines from android and so I have icon in different size:
drawable-hdpi (96x96)
drawable-hdpi (72x72)
drawable-ldpi (36x36)
drawable-mdpi (48x48)
But on the Samsung Galaxy Tab the icon gets a weird purple/pink-ish border. The Game 'Angry Birds' seems to have the same problem. Facebook was able to change it to blue. So what is this border and how can I remove it?
Screenshot
I've observed that the Tab picks some background color to use to frame your icon, even if the icon is rendered with a transparent background: the calendar has a dark frame, gmail has the same pinkish/purple color as Angry Birds, and my icons which have transparent backgrounds/no borders on the Nexus 1 have weird blue colors. In fact, ALL of the icons on the Tab have a background and border. I've had to conclude there is no way to get rid of it, and there is currently no published algorithm as to how it picks the color.
This answer from
user
#int ermedi_8
to question
Can Icon Border Be Eliminated In Android App?
seems to work on my Samsung device: I don't know whether it works on other brands. Of course it only helps for your own apps where you can put code into AndroidManifest.xml.
Quote:-
Though it is old, maybe it still helps someone:
Thanks to #deloreyk hint about TouchWiz i found this site where Josh Barton suggests to add a meta tag to your AndroidManifest.xml
<meta-data
android:name="com.samsung.android.icon_container.has_icon_container"
android:value="true"/>