I use ActionBarSherlock. In one of my Activities I have SearchView. When it expands i change background of ABS from gree to white. So I need to change Up arrow too. Well, the question is: how can i change its color or set ImageResource on it from code?
Related
Question
how Can I use colored icon in the Bottom Navigation Activity? I have a logo which I placed in the drawable folder but in the navigation bar its showing in black and white color instead of regular color as I copied in the drawable folder. Please share your thoughts. I am using kotlin language.
You can try using bottomNavigationView.setItemIconTintList(null);. This may work. But still, I'll suggest using a different library as mentioned in my comment.
You have to provide color in onClick listener using
window.navigationBarColor = Color.GREEN
Use Color.parseColor() to set some custom color to Navigation Bar
How can I change the Android StackedActionBar's Tab text color, Tab divider color, and selected navigation Tab selector color dynamically at runtime using java? I have not been able to find solutions for this without having to alter my XML each time. I have however been able to change the StackedActionBar's background color using the method for the ActionBar class:
setStackedBackgroundDrawable(Drawable drawable)
Thanks for any help in advance.
If you are adding Stacked Tabs to the Actionbar pragmatically, then you can do the styling stuff via Java. If you are declaring the Actionbar's components in XML, then you cannot highly modify the styling stuff via Java.
Here is a detailed link for dealing with Action bar.
I am using the ActionBar from the ActionBarSherlock library. I am able to set the background color of my action bar using the ActionBar.setBackgroundDrawable(Color) method. After changing the background color, I later need to revert it back to the original/default ActionBar color.
How can I determine what the original/default color used for the ActionBar was?
Depends on the theme you are using. It should be
R.drawable.abs__ab_transparent_dark_holo for Theme.Sherlock
R.drawable.abs__ab_solid_light_holo for Theme.Sherlock.Light
R.drawable.abs__ab_solid_dark_holo for Theme.Sherlock.Light.DarkActionBar
Don't just Create a Model class that will remember what you are setting, and you be able to roll back when ever you wish.
Is it possible to change overflow icon in code?
I read this solution: Changing overflow icon in the action bar
But I need to make it in code, to select white or grey style during runtime.
Is it possible?
You can only change this in a theme.
One potential solution would be to call setTheme as the very first thing in onCreate with different themes depending on whether you needed white or gray.
I'm using ABS, and I basically just want to know if there is any property that will let me overide the default blue I'm getting in a button down. My application is all red, and it's a small detail that's killin me. Ideas?
The actionBarItemBackground theme attribute will allow you to change the action item selector.
If you're using it with ActionBarSherlock be sure to provide an entry with and without the android: prefix.