I'm using Launching Icon Generator to build my Android Icon Apps, but I can't get the same shape to the other icons in Android. What's wrong?
My icon in the mobile screen looks like that...
I'm using Lainching Icon Generator in this way...
How to be sure that my Icon will adapt the Icon Shapes in different Android versions?
Remove the padding which is set to 25 in attached screenshot. Also make sure to have transparent background.
for better solution u can use android studio in build tab "Image Asset".
from there u can select foreground as your icon and background as your background theme.
Related
I downloaded some icons from material.io but they only offer the icons in black. I saw a youtube video where they use to allow you to choose the color. Anyway, I am trying to change the colors of the icons to white. I am not having any luck. I tried to change the fill color in android studio but it doesn't work. Any assistance would be appreciated such as exact code and files to add the code to. Thanks.
simply you can use
android:tint="#android:color/white"
You can directly download these images in Android Studio.
res > right click > New > Image Asset and select
Icon Type : Action Bar and Tab Icones
Asset Type : Clip Art
Theme : CUSTOM
And you can select any clip art that you want, select the color, padding, etc ...
As mentioned before, the material.io icons can be downloaded directly with Android Studio. This solution shows the importing of vector asset icons which are easier to manage since they are stored in a single location (res/drawable) vs. image assets that will have each icon stored in specific density folders (hdpi, xhdpi, etc).
expand the "res" folder
right click drawable
hover over "new"
select "Vector Asset"
click the image next to "icon"
select desired material.io icon
Name the icon what you would like
select "next"
Now you will have two options of setting the icon color
In the layout by using the android:tint attribute of an ImageView. This is my preference because the icon can be viewed prior to runtime.
or
In Java.
imageView.setColorFilter(ContextCompat.getColor(context, android.R.color.white),
PorterDuff.Mode.MULTIPLY);
https://material.io/icons/ actually does let you download icons in white.
But, depending on what exactly you want to do, there are a few options. If you simply want white icons (and not to change them at runtime), you may find this plugin for Android Studio useful: https://github.com/konifar/android-material-design-icon-generator-plugin
It allows you to generate the material design icons right in Android Studio, in whatever color you want. Another alternative for downloading these icons in different colors is https://materialdesignicons.com/.
If you do want to color the icons at runtime, try something like this:
imageView.setColorFilter(ContextCompat.getColor(context, android.R.color.white),
PorterDuff.Mode.MULTIPLY);
You can download white icons from material.io. also look at themes and theme overlays
Instead of android:src
I use attribute android:foreground
android:foreground="#drawable/ic_add"
For those not getting what they want yet try changing the PorterDuff mode, the following is what did it for me
imageView.setColorFilter(ContextCompat.getColor(context, android.R.color.white),
PorterDuff.Mode.SRC_ATOP);
maybe
app:iconTint help you, I am writing this because of the following reference.
Material Design 3
I have found several answers on here as to how to change the background color and add a custom icon to the title bar in android studio but am having difficulties finding an answer for how to use a custom image as the background instead of just a color in the title bar. Any help would be much appreciated. Thanks.
sadly you cannot add images as the background on both the header and textView/webView that's why you don't see any apps on android with image backgrounds. you could try using html instead of xml, like:
replace colors.xml, styles.xml, ect with colors.html, styles.html, ect
but i doubt that will work. hopefully they will add this feature later in the android sdk.
I found this Asset Studio to generate icons. It works fine for the launcher icon but for action bar or notification icons it is not working. I put in my png file and want to generate the icons, but Asset Studio is only generating gray circles. Is there another tool to generate action bar and notification icons?
You can use a tool for creating generic icons in Asset Studio: https://romannurik.github.io/AndroidAssetStudio/icons-generic.html.
To get it look like ActionBar Icon, you should make next actions:
Choose image
The size of image should stay at 24dip
Change padding to 4dip
Move foreground color thumb to 0%
That's it! Download .zip now.
The sizes of icons will be pretty the same as you can get them with ActionBar Icon Generator.
How it looks for me:
Use this instead https://romannurik.github.io/AndroidAssetStudio/icons-generic.html
Here demonstrating how to show the image:
upload your image
set the foreground color to 0, just like below
Thanks to https://stackoverflow.com/users/3225458/romtsn
I think it's because your image is too complexe and the main problem is the "color" filter applied in AAS.
I had the same problem and I had to convert xxxhdpi xxhdpi etc. manually. If you work with Sketch (for example) it can be converted easily with a plugin (https://github.com/zmalltalker/sketch-android-assets)
hope it's help !
If you want to use AAR, like #rom4ek explained "4. Move foreground color thumb to 0%" this is the important part
You can use the built in feature of android studio to generate actionbar and notification icons.
Right click on res folder and New > Image Asset. You can choose Launcher Icons, Action Bar Icons or Notification Icons in the Asset Type.
Update:
You should look at this. It talks about white icon in notification.
I use an own module 'icons' with a Gradle script to generate icons. This is a more automated way than the Assets Studio can provide up-to-now. The icon will be designed with Inkscape. See my blog for a detailed description. You find an Android Studio Project on GitHub.
I face the same problem their is no issue with icon after Lollipop notification icon do not contains color icon it support flat,Silhouette icon supported.
Either you can change target SDK to 20
Or generate flat icon(icons8 is best option)
Or
you should use a condition
boolean useWhiteIcon = (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP);
return useWhiteIcon ? R.drawable.icon_silhouette : R.drawable.ic_launcher;
after alot of search this is the solution:
the problem is you are adding an image with white background..
to convert the image to actionbar icon you have to load image with transparent background
Android Studios 2.2 has an Image Asset Studio that you can use to generate your icons.
https://developer.android.com/studio/write/image-asset-studio.html
By default it will be grey color for any image. But you can customize it according to your color. Check below screenshot to select CUSTOM tab and then select color you want.
Hope it helps you.
I'm trying to color the icon's background of my notifications on Android L. I think I saw an API during GoogleIO and the attached image actually shows a green background, but I can't find anything on the documentation.
Can you point me to something?
BONUS QUESTION: How about the background color for Wear Notification? Does it use the same API?
This color can be changed like this:
.setColor(context.getResources().getColor(R.color.theme_primary))
This may be silly but I've been looking over an hour for the Up Indicator icon so I can customize it in my image editor tool. Where can I find that icon? It is not in the Android Design Icon Pack, as I just searched in it.
If you have SDK installed on your device, you can find the icon in %SDK-FOLDER%/platforms/android-*/data/res/drawable-*/ic_ab_back_holo_light_am . You can take from there and edit it.
Try this one: http://romannurik.github.io/AndroidAssetStudio/index.html
It has many other icons not only the up button. You can also change the icon color if you want.
My original answer called out that the icon exists in Android by default and that it does not to be manually added.
But this did not address the question as asked.
You should be able to get the icon from the Android libraries themselves, or from Google material design icon back available here (https://material.io/tools/icons/?icon=arrow_back&style=baseline)