I have following issue, am developing an App for Android and I realise that the launch icon AKA ic_launcher is quite smaller than al the rest of the App that I got from GooglePlay.!see image below.. I tried as normal (on eclipse: new->android icon-set->....) using a 512x512 png file, then I gave a 2nd try using a recommended link I found by searching a solution (Android Asset Studio)
you may want to say " is not tooo much" but that is what I need, must be the same size as normal apps...
thanks in advance!
see the dotted line as reference to verify the size
Just create icon 512x512px without any generators, they add margins to a picture. You have to draw icon from border to border.
Use an existing application icon as a template, for example - mine
Related
I want to use the default launcher icon provided in android studio as an ImageView. I used the android:src="#drawable/ic_launcher_background" XML tag in my imageView
But I got this as the result:
But I want this in my ImageView:
you are setting ic_launcher_background for this ImageView and you got it
till Android 7 app icon was a single image, oftenly called ic_launcher. Oreo introduced Adaptive Icons, which have two layers - background and icon/logo itself. so you need two ImageViews or LayerDrawable, the second/top layer will be your icon/logo (ic_launcher_foreground? inspect your drawable or mipmap folders)
note that background layer may get some cuts in device launcher - may be square, but also round, rounded corners all or only one etc. also foreground/icon itself may move a bit, just like visualised under above link - when you use old icon ic_launcher on newer devices it won't be exacly same as shown in device launcher
Try this
android:src="#mipmap/ic_launcher"
Hope this helps...Feel free to ask for clarifications...
The default icon provided by the android studio is actually a combination of two different drawable. See the below picture (you can check the same in your project). You can use the icon as an ImageView by stacking one of the drawable on top of another (which is not a good idea) or you can also directly use android:src="#mipmap/ic_launcher". Just as #Vishnu said.
I just swapped my android launcher icon(just learned how). I noticed MANY icons on my android are circular and I am wondering do I have to get an image done like that OR is there way I can have the launcher put the icon(a png with transparent background) and draw a circle for the launcher somehow? (this would be easier that fooling around in some drawing tool as well).
In the app I used CircleImageView for contacts which did the circle but that was in java, and android launcher is xml so not sure if I can use CircleImageView?
You'll need to use adaptive icons instead of a single image to allow Android to adjust your icon. Essentially this is defining a background drawable and a foreground drawable, and Android will do the rest.
If you right click your res/drawable folder in Android Studio, then select New -> Image Asset, you will see the following wizard. This will let you easily create launcher icons that work in all shapes.
For further information you may find the official Android docs helpful, as well as Nick Butcher's excellent guide.
I'm trying to implement a launcher icon for an Android app. I'm using Android Studio's New Image Asset capability to create the icon from an image file and it works in most places except for the later Pixels.
On the Pixel 3XL, it looks like the following figure. The icon with a round white border around it.
On the Pixel 2, it looks the same
But on an original Pixel, it looks right:
I created the icon assets using the Android Studio New Image Asset capability. Selecting the image icon as shown in the following figure:
Then I set the background to the background color for the icon:
Based on what the UI shows, the icons all look right and Android Studio is supposed to generate the right files for all target platforms. Can someone please help me understand what I need to do to get rid of that white border on later phones?
You should add ic_launcher_foreground.xml and ic_launcher_background.xml to drawable file in your project. As far as I get it, you've try to make red background then add red backgorund layout you have only foreground image in this way. Btw that is not a bug that is a feature :)
I wanted to ask how to change the app icon of my app on a Galaxy S7 running on Android Nougat (see attached screenshot) to fill the whole icon space.
Is there a way to do this?
EDIT: I think it's because these apps have square icons and mine is circular. Is there a way to make it square for Galaxy S7 Nougat devices and for all others round?
You can disable this by adding a meta-data element to your manifest:
<application>
<meta-data android:name="com.samsung.android.icon_container.has_icon_container" android:value="true"/>
</application>
This solution is only for user's end:
Go to settings -> display -> icon frames -> icon only.
This should change the icons into full size icons.
From https://developer.android.com/about/versions/nougat/android-7.1.html
Apps can now define circular launcher icons, which are used on devices that support them. When a launcher requests an app icon, the framework returns either android:icon or android:roundIcon, depending on the device build configuration. Because of this, apps should make sure to define both android:icon and android:roundIcon resources when responding to launcher intents. You can use Image Asset Studio to design round icons.
While that may not be sufficient to deal with Samsung's "special" white frame for icons, this gif shows a few ideas for creating icons that look good whether they are the normal size or framed "Squircle" style.
https://www.androidcentral.com/sites/androidcentral.com/files/article_images/2016/12/squircles.gif
In any event this means you now have to worry about a normal icon, a round icon and a Samsung-ized icon and there is no way to provide an icon for the Samsung-specific launcher design.
I met the same problem and tried various things. Now I found one interesting thing.
If you make an icon without any transparency, the icon will be the full size on the Nougat android phone. When I made an icon in the paint.exe and saved it as .png, there was no problem.
I think this will help you.
EDIT : below is what I met, explained in my comment
EDIT2 : the sizes and shapes of two icons (with and without transparency) are identical. the only difference is one has transparency and the other has white background. Definitely I don't mean that I deleted transparency and enlarged the image.
EDIT3 : more explanation about my icons #Hadas
My problem is that the App Icon on my device looks way too small in comparison to the other apps. I read some solution on other questions, like this one Android App Icon size too small but this doesn't seems to be my problem. In the Android Studio you can make a right click on "res" where you can find new --> image asset where you can create such a icon. it creates icons for all the different sizes like mdpi, hdpi and so on. So i thougt that i might display the app icon correctly but it doesn't. can anybody help me?
In "Configure Image Asset", click "Legacy", change "Shape" from "Square" to "None", and the image padding will appear. Go back to "Foreground Layer" and resize the image to fill the padding.
Try to use this. Its very useful, fast and free. And thats what I use.
If your icon already has a shape, remember to set the shape to none. Hope it helps!
If you are getting the same results, I also recommend this website, where I usually get "bigger" icons.
I found the launcher icons generator puts there a small padding, that is the reason for smaller icons. On the other way it is recommended by Google team here.
Android expects product icons to be provided at 48dp, with edges at 1dp.
All is on you to decide. In case the icon applies to whole square space - use padding, otherwise when small object is not square shape, rather fit to edges :)
I had the same issue. I fixed it like so:
Create the adaptive icon through Android Asset Studio. In the third tab you can select "Create Legacy Icon". Only this legacy one is going to be too small! The others will be fine.
So the thing I did was just to replace the icon_launcher.png files (this is the legacy icon).
If you use any single image directly as android:icon="#drawable/ic_launcher"
It'll be shown correctly on old devices but on android 26+ it'll appear small
Use this approach to make the icon appear like fitXY scaleType for imageview, that is, it's corners can be clipped like cardview but it will not be shrinked
Step 1
Delete ic_launcher from drawables and paste it in mipmap-xxhdpi-v4
Add transparent padding of width/6 px to your launcher icon online
Step 2
Paste the second file as ic_launcher_foreground
Step 3
Create ic_launcher.xml under res/mipmap-anydpi-v26 and add this content
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="#mipmap/ic_launcher_foreground" />
<background android:drawable="#color/colorTransparent"/>
</adaptive-icon>
Step 4
Edit the manifest and use mipmap instead of drawable
Now your icon should not appear shrinked/zoomed
This is useful when your app icon can't be split into foreground/background eg some graphic image as app icon
How it works:
For API26+ devices, mipmap-anydpi-v26 will take precedence over mipmap-xxhdpi-v4 and system will load icon from xml, which in turn, loads foreground from ic_launcher_foreground, automatically crop 2/3 of its size because it's 'adaptive icon'. (This is the reason we add padding of width/6 from all sides
For older devices the ic_launcher.webp will be used directly
Tested on API 21-31