I'd like to change the style of this ActionBar Spinner below. It's all about changing the colours of the followings:
the selected text in spinner header (1. - currently gray)
spinner drop-down selected text (2. - currently white)
spinner drop-down non-selected text (3. - currently gray)
One more thing, it's generated with Android Action Bar Style Generator:
http://jgilfelt.github.io/android-actionbarstylegenerator/
Do you have any idea how can I do this?
Thanks in advance!
Try this programmatically :
spinner.setBackgroundResource(R.drawable.yourDesign);
spinner.setPopupBackgroundResource(R.yourDesign2);
This tool (Style Generator) is supposed to help only with the resources (images and xml's) to create custom action bars.
To change text colors, do it directly in the xml of the Spinner. Or, if you're using some kind of third-party component, change it via Java, with an Adapter and its specific configs.
By the way, this plugin is now deprecated. Consider using Toolbar or its support library equivalent.
Related
I am using ActionBar (Compat) version of PullToRefresh library (https://github.com/chrisbanes/ActionBar-PullToRefresh) in my Holo Light application.
See https://dl.dropboxusercontent.com/u/10057117/ns_bnp_dev/styles.png to see my basic layout.
Now my customer asked me to change the blue color of selected tab in action bar and blue color of indeterminate progress bar that is shown by pulling the list down (part of PullToRefresh component).
I failed to find some easy way to do so.
I am able to change the background of tabs in actionbar by creating new drawable resource for whole background. I believe there must be some more easy way just specifying the color.
I am not able to change the color of the progress bar, PullToRefresh's ptrProgressBarColor attribute applies only to progress shown when in pulling gesture.
Anyone has the experience with re-styling any of these?
Thanks a lot
If you want to change the color of the indeterminate progress bar,
change the
<color name="default_progress_bar_color"> #FF33B5E5 </color>
in the colors.xml of the PullToRefresh library.
I defined a color for my whole app (a dark grey) and so when I click on the ShareActionProvider, a black list shows up but the text color is dark grey too (and so not really visible). The text in the ActionBar is white, but not the one in the list.
Is there any way I can set a different color (some item in styles.xml ?)
Thanks
Best way to customize shareActionProvider is create separate menu specifically for Sharing. See this link https://stackoverflow.com/a/22192759/1237175
I am trying to find the method to change the underline color or background of the tabs in action bar through some code but can't find the answer? Please help
Per the Android Documentation on customizing the tabs of an Action Bar:
"To change the indicator used for the navigation tabs, create an
activity theme that overrides the actionBarTabStyle property. This
property points to another style resource in which you override the
background property that should specify a state-list drawable."
You may also want to look at this style generation tool that I've found helpful. It will auto generate the Action Bar style based on you GUI selections. Might be a bit overkill for some basic things. But, you can also pull out just the styles you need from the generated code.
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 would like to modify the background of the title bar of the dropdown dialog associated to a spinner.
If this is not possible I would like to know what resource is used to draw this background android.R.drawable.* ?
This is an effort of uniformity for my various pop ups in my application.
You can change everything using styles and themes.
Take a look at this example for buttons:
http://blog.androgames.net/40/custom-button-style-and-theme/