Different icons for same application in Android - 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

Related

Prevent Android from changing the theme

I've set theme `"#android:style/Theme.NoTitleBar", but Android keeps switching the way the controls look on different devices.
Is there a way to prevent Android from changing the theme of the application without writing a custom theme?

Want to change icon as the theme apply on device

I am trying launcher for android device, I want to add the themes and styles, applying these themes icon of the app should change same as every launcher provides. if anyone can help . Thank you.

Kitkat embedded themes

Where can I see all available Android themes (under 4.x Android)?
I need something like gallery with images and descriptions of each theme.
I'm tired to try them blindly (set theme and relaunch application to see what I set up).
Thanks!

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

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.

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