How do I decide which icon to use depending on background? - android

I downloaded some free icons and created a notification. At first I thought something was broken but then I realized that the icon I had used was in the same color as the background.
The pack I downloaded included several versions like "holo_dark" and "holo_light". I assume that this has something to do with theming in different android versions or user customizable settings.
What is the intended way to figure out which icon to use in such cases?

The icons are specific to the theme that you will be using in your android application. You have to identify the theme in your application and then use the specific set of icons for your theme.
For more clarity you can refer the Android Asset Studio ActionBar and Tab Icon Generator and see the difference in icons generated for different themes.
Also this article will be very useful in understanding how Styles and Themes work in Android.

Related

Using icons for app from internet for android app

I am wondering what are the legal ramifications of using an icon from the internet in my app. I am not much of an artist but there are gazillions of icons on the web. I was going to use one and tweak it a bit and use it for my android app. Is this legal to do?
Thanks.
If you wish you can use your icons from drawable folder by creating vector icons giving it your own colors and styles

Android toolbar icon color not so bright

I am developing an app in which there are multiple tabs with icon without any title. The problem is that the icons are not looking as bright it should. I used white color(FFFFFF) in creating icon assets. Still it doesn't looks so good.
The pic above shows Facebook Messenger and my App. There is difference between color(although both are white).
Any suggestion will be appreciated.
Yeah I have experienced similar problem. I think it is fault of android asset studio when I create icon with white in reality they are no white as I expected.Then I found very good online studio which is same as Android asset studio even better than that. Solution for this I think you have create icon out from AS then import them to appropriate folders.Here online icon generate web site link
Note: The question is old, but I consider sharing this information could be useful for anyone who could stumble upon this issue in the future.
If you use the Asset Studio tool from the Android Studio your icons will contain
alpha channel with a value of 60% (value depends on selected colour). I provided an example below.
In case you can use vector graphics it should work for you because you can freely edit XML file describing the generated image. Just remove android:alpha=".." attribute.
If you cannot use vector graphics and want to avoid transparency use this official online tool from Google to generate material icons for your application.
This tool supports multiple sizes, black and white colours, and SVG as well as PNG format:
Issues example of 60% alpha channel in Android Studio:

Different icons for same application in Android

My Android application has two style themes. And i am wondering is it possible to set two icons for the same application and switch between them, when user changes App theme? Each icon for one style. Thanks

Can I modify android platform drawables without problems?

For my app I need (like I think many and many devs) to customise colours and drawables; at the moment I need to customise a platform drawable (the action bar background, which for the android platform is ab_solid_light(or _dark)_holo.9.png) which can be taken from various sources (android.jar, git, etc.). In my case, I'd like to modify it from grey to another color; can I simply take it, modify it with gimp/Photoshop/similar application and include in my resources? Should I give credits to aosp in "open source licenses" section of my app? Is there a standard or conventional way to do these kind of things?

Set drawable icon in menu based on theme

I'm creating an app supporting versions 2.1 and up to what's currently available.
Now, I'd like to make use of drawables available to the user's current theme and/or Android version when designing the ActionBar I'm creating.
The drawables enabled in every version provided by Android are very crisp and non-ambiguous, perfect for my needs.
Problem. I can't access, for instance, #android:drawable/ic_menu_refesh in my XML-files throughout my project.
There is of course the possibility of copying icons from a specific android version and using those, but I can't really see how I would make this sanely working without copying every version of the icon from every build and keeping track of what version an Android is currently running and reference the suitable drawable.
Another issue, themes(?) such as Sense are making things even that much harder. In my app I'd like to use the device's current theme. In my case I have an ICS-device that uses Dark Holo-theme and a 2.3.6-device that uses its default theme. In these cases this means selecting a suitable light colored drawable for the ActionBar/menu.
Problem. In Sense on my HTC Sensation S the background color of menu items are white, which means I now have to pick a suitable dark icon.
How would I go about this to be able to use the device's current theme, and still provide adaptable drawables so they fit the look & feel of the theme?
If I'm understanding correctly, you are wanting to be able to just reference the default icons, say the "menu refresh icon", and have it appear as it does in the system apps. I do not know of a way to do this, and recall reading Android documentation that warning against referencing default drawables, as those icons may change in future versions of Android and your app will not look as intended.
Generally, you will need to create your own icons for each menu item/actionbar item/notification/etc. There are simple tools out there that can create custom and default Android icons for different system themes. You can use resource identifiers in your res folders to have different icons for different API versions/layouts/densities/etc.
http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html
I do not understand why you are setting your icons to gray... What I think you are forgetting is that your app sets the theme, you can choose whatever system theme you want, or have a custom theme that extends from a system theme. Whether you choose dark or light, you only need icons for the theme you set. The only kicker here is to make sure you have icons for varying API versions that differ (i.e. menu icons 2.2 vs 2.3 vs 3.0+), and all you need is to make each API version and use resource identifiers to make sure your app uses the proper one.
If your app supports more than one theme, you can have it use different icons for each theme. See how to do so in my answer to a similar question:
Change ActionBar Menu Icons depending on Style
The only way I could make this work was by copying the icons I wanted provided by Android and then recolor them to a middle ground shade of gray. Not a very ideal solution but it will have to do.

Categories

Resources