My android app icon is a png image with a transparent background. In the image asset configuration IN ANDROID STUDIO, I set its shape to be NONE. However still, whenever the app is installed on my device, a purple square background is present. However on another version of android, the app icon background is transparent. How do I remove it? Can somebody please shed some light?
Related
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 need an app icon with a transparent background, but for some reason, the background is black at Full Bleed Layers. Does anyone know how to fix it?
Screenshot of Icon
This is not a duplicate question!
A PNG image is to be used as the icon foreground, and the background should be completely transparent.
Using Android Studio > New Image Asset > Configure Image Asset dialog in the Asset Studio, virtually very combination of options for the background has been tried, including removing the file entirely from the path and deleting the background tags in ic_launcher.xml and ic_launcher_round.xml.
Removing the file from the path in this wizard and removing the tags from the XML files almost does the trick, but a faint black outline remains as the background (~alpha=20%). All other options for the Background Layer leave either a stark white or black background behind the foreground image when viewing the icon on the device's launcher.
Many apps manage to have a foreground only on their icons, so it is possible. What am I doing wrong here?
Update: Thank you for the quick comments! I tried both the solutions provided as answers, same result. Screen capture is uploaded as suggested.
Updating just the Legacy icon in the wizard is not sufficient, as that only changes the Legacy icon format. The newer "Adaptive" icons are required as well. Even if the background is set to a completely transparent square png, Android Studio changes it to white. If the background file is removed entirely, the wizard allows completion, but then Android Studio uses a slightly opaque black background, as shown. With respect to the uploaded image, there should be nothing behind the foreground, completely gray to in this case without any visible circle.
Screen capture from device running API 25
Method 1:
if you have a png, just copy it and paste it in drawable, and refer to image name from manifest.
<application
android:allowBackup="true"
android:icon="#mipmap/new_image"
android:label="#string/app_name"
android:roundIcon="#mipmap/new_image"
android:supportsRtl="true"
android:theme="#style/AppTheme">
....
</application>
Method 2:
Goto file > new > image asset, make sure you select a png image (with transparent background) & set background shape to none.
First you have a background image to get transparent icon without any background image you can't get your icon transparent .
And if you look to get image transparent you simply use some photo editor.
Get a view of the imageButton
View v = findViewById(R.id.myImageBtn);
get the icon from the app for example Chrome
pkgnam="com.android.chrome";
Intent intent1 = ctx.getPackageManager().getLaunchIntentForPackage(pgknam);
Drawable myIcon = getPackageManager().getActivityIcon(intent1);
set the background icon the same as the foreground icon
v.setForeground(myIcon);
v.setBackground(myIcon);
I am trying to remove the Grey and White Chequered background from a launcher icon jpg file using Android Studio's Image Asset.But no luck so far.
Is there any way to do this?
below is the Background :
The checkerboard background is for transparency. Same happens in paint.net. If you end up with transparency, you get a checkerboard like that of white and grey.
It is technically not a background, you don't actually see that in the launcher. Alpha shows as a checkerboard to ensure you know you are seeing alpha. If you install it on a device, you can see what is "under" the launcher icon. If your icon is 256x256, and has a 10x10 square of transparency in the middle, you will see a checkerboard there too. If you then launch it on the device and check the launcher, you will see that there is a see-through hole in the middle.
Basically, the checkerboard isn't a background - it is transparency.
With the exception of the times where you actually create a checkerboard on purpose, but that can then be deleted by modifying the .png file
Right-click on image, form the menu that pops up select Hide Chessboard.
I have tried built in tools in android studio using res -> new -> Image Asset and then selecting notification icon.But after selecting the images it shows some grey and black boxes and not image icon and doesn't show in notifications as well.
I have researched and found that image background should be transparent for it to work but that didn't work also. Also i have tried images of 24x24 size as recommended but couldn't get the icon working in my android app.
Thanks in advance for any useful suggestions.
For v21 and above--> In notification icon, only white and transparent colors are allowed. Use white color what u want to show, rest part make it transparent.
For v20 and below --> You can use any image with proper dimensions.
Refer here for details.