Does navigation graph supports theme? - android

I have multiple themes in my android application. Now in navigation_graph or mobile_navigation (whatever you called it), I am not getting theme changing opposition as we have in layout.

Related

Android theme in library project

I have a library project providing a few activities. Some are immersive, and I need the action bar to be created. On the other hand, the clients using the library must be able to customize its theme (mainly the colors).
One of my clients is using the Theme.AppCompat.Light.NoActionBar theme, which removes the action bar from my activities.
Is there a way to ensure that the action bar will be shown (so, my activities' themes have to inherit from Theme.AppCompat.Light.DarkActionBar), while leaving the colors customizable?
Programmatically creating the action bar would be fine, but I'm not sure that this is possible, right?
EDIT: It works if my client declare the library's activities in their manifest, and set a DarkActionBar theme on each. But I'd really prefer to avoid that solution, as currently they don't have to declare our activities thanks to the manifest merger.

Changing Navigation Bar color while using #android:style/Theme.Holo.Wallpaper.NoTitleBar

Actually I am using
#android:style/Theme.Holo.Wallpaper.NoTitleBar
in my android launcher app. But the problem is when I am changing
navigation bar color
for lollipop and above devices, it's not changing. I tried pro-grammatically as well as from styles.xml.
If I am using appcompat theme, then it's working. But I don't wanna use appcompat theme for my launcher app. So what is the reason behind it and give me solution as well.

Custom Actionbar icon compatible with other themes the user may choose

When creating custom ActionBar icons what happens if the user changes their theme to something that makes your icon unreadable? Do they have this kind of power?
Example: So say I make an icon for my ActionBar in Holo Dark, so that the icon will be a lighter shade of white. What if the user changes their theme to Holo Light (or can they in my app?), forcing my icon to not be readable because it is also close to the same color as its background? I'm just concerned that if I create a custom app it will not look proper to only certain people.
I have been trying to find something about this but my searches and Google's Iconography pages didn't really give me a clear answer.
Android allows setting a themes to application/activity in AndroidManifest.xml, and you can change theme theme dynamically. If a user change their system themes, it don't affect you application. If you want to change your application/activity themes, you should call setTheme() before setContentView() in Activity.onCreate()

Android Theme.Translucent on ICS render all the child elements as gingerbread

I am developing an Android application where I have set the following theme to one of my activities so that I have a nice translucent background.
android:theme="#android:style/Theme.Translucent.NoTitleBar"
This works pretty well with versions before 14 (ICS), but on ICS, although the activity is shown with translucent background, all the elements inside the activity start using Gingerbread theme. i.e. the buttons inside the activity are displayed with yellow highlight when selected instead of blue on ICS. Similarly, a spinner button when activated/clicked display the items as dialog instead of ICS popup/popdown style.
Can anyone please help me on how to get the translucent background along with the ICS theme?
To have the blue highlight from ICS and up you need to use a Holo theme, all other themes will render components as if they are being displayed on Gingerbread and below because that is how the theme is telling the system to render them.
You could extend the Holo theme of your choice and use the members from the translucent theme which will give you your desired effect on ICS and above.
The theme data is available in <android-sdk>/platforms/android-<API-level>/data/res/

ActionBarSherlock doesn't show ActionItems when using dialog theme

I am trying to update my app with the new ActionBar paradigm. I want to keep compatibility backwards though, as my largest user base is still on Gingerbread.
To that end, I am trying to integrate ActionBarSherlock into my app.
My app is designed to use the dialog theme, so when I integrated ABS, I tried to use the corresponding dialog theme as so in my AndroidManifest.xml:
<application android:theme="#style/Theme.Sherlock.Dialog" >
My ActionItems would not show up though, and only appeared as old-school menu items (meaning they were completely inaccessible on my tablet). Looking at the samples in the ABS download, I decided to try changing my app and removing the .Dialog qualifier, changing my AndroidManifest.xml to:
<application android:theme="#style/Theme.Sherlock" >
Once I did that, the menu items moved from the menu to the ActionBar, where I expected and want them to be. So it would seem that, with default conditions, ActionItems are not enabled when using the .Dialog theme.
Is there any way to enable this behavior, so that the menu items would show in the ActionBar as expected while still using the dialog theme?

Categories

Resources