By default android.R.drawable.ic_menu_delete is semi-transparent so that the color of the action bar will show through the icon.
If I wanted the ic_menu_delete icon to be solid white to match my other icons, is there a way to do this other than image editing software?
You could create a CustomDrawable that would draw stuff without the transparency but it sounds to me way more work than head over to android asset studio select the icon and download.
Related
so I want to make icon for push notification. say for example I want to use the android image below as notification icon
https://p7.hiclipart.com/preview/135/689/279/android-computer-icons-logo-android.jpg
so I try to make it using Android asset studio. but the image generated from this Android Asset studio is completely white like this
what should I do ? is there any image requirement for this ?
Use Transparent Images
The icons generated will be totally solid color (dark grey or white will be used on the device depending on theme).
The icon you add should only contain the "shape" you want to show as the single color. The rest should be transparent pixels.
Any non-transparent pixels will be converted to white. So if you have a square logo with no transparent pixels, it will be a giant single colored square.
Use a .png image so you can save it with transparent background.
As you can see, icons in notifications bar are white, that's why you are seeing all white
I have an app on android that create home shortcut icon.
The image of the icon is image that i set programmatically from the drawable
Now the problem is, when the shortcut was created on the home screen it's created with white background.
How do i remove that white backgroubd and set image to full size of icon?
Thank you all..
EDIT: the app i was talking about is app that i developed using android studio and just want to set full size of image when i create home shortcut
This is highly dependent on the launcher you use. The image looks like the standard google android 8+ (?) icon shape.
I theory it could be part of the icon you created but since you are asking this I doubt it.
In older versions of android the outer shape of the icons were individual, while rather cool and the outline correctly shown while dragging them etc many complained about the lack of a uniform look of all the icons in the app drawer etc.
It was introduced to make all icons seem more uniform.
Long pressing an empty space in the Google Pixel launcher for example shows a choice to go into the settings for the launcher and there you can change the shape all icons should have:
In addition to this, apps can take advantage of the various shapes and adapt to them and fill them out so to speak. See for example the Chrome icon while changing the icon shapes in the launcher settings.
Introduced in android 8: The feature is called adaptive icons.
See the docs about adaptive icons here:
https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
That is because of adaptive icons - a feature of Android 8 and can't or shouldn't be changed. You can at best change the colour of the background.
i removed the white background from the launcher icon by following these guidelines https://developer.android.com/studio/write/image-asset-studio
a few more points
in the background layer, move the slider to resize the icon until you see no what would have been the white background.
in the manifest file, change the icons to reference the mipmap folder;
android:icon="#mipmap/yourlogo"
android:roundIcon="#mipmap/yourlogo"
I have three different applications, all of which I am using the same style to create icons. Right-click mipmap > New > Image Asset
Using these settings:
But two icons have shrunk to the center of a round icon (blue and green) and one has the full icon as a square (Red) Which is I want.
When I look in Finder at the icons themselves they look normal.
Any ideas?
Read the Adaptive Icons Documentation. If you target 26+, you need to provide adaptive launcher icons or the launcher will place your default icon fully within the mask of the launcher icon background. Notice that Gmail also has the white circle around its icon in your screenshot.
I have a PNG logo file that I want to display inside navigation drawer. But whenever I add the image asset to "mipmap", it adds white background and bounding boxes around the image. How to fix this?
Original Image:
After adding as image asset to Android Project's "mipmap" folder:
The 'mipmap' folder used ONLY be used for App icons. And these icons HAVE to have the same width and height. If they aren't, Android Studio will add extra white space to them.
Create a new icon that is square, but simply make some of the image transparent. Then you'll get your desired effect.
It is because the Shape property was set to Square by default. I changed it None, its fixed now. Thanks for responses.
Run the app - if it still shows - use PhotoShop to make the png.. your png is not made correcty
The problem is when you add it as an image asset as launcher icon it adds white background to the image sometimes if the image isn't of the specified size. Use this option only when you're adding launcher icon, use action bar and tab icons option that won't add any white background to the image, select the theme holo_light theme will make the image dark, and holo_dark theme will make the image white, don't worry you can change the color of image of any custom color by selecting the custom theme while uploading or, you can use the android:tint attribute in the layout file. And add app related graphics in the drawable folder only.
I read Android Menu custom Icon but I do have "#drawable/ic_myimage". Instead of my png, a gray box shows up. I created the icon set by right clicking res, new android icon set, and browsing to the png on my hard disk. the pngs show up undeneath my resource resolution folders as "ic_myimage.png". I created icon sets the same way but with clipart and those show up fine next to this gray box that should be my own png.
in order to create an icon set, the image/icon you want shown has to have a transparent background.