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.
Related
I am a noob on android graphics and I would like to change the appearance of a seek bar without creating a completely new custom view. I noticed that if I change the android:theme="#android:style/theme..." of the activity in the android manifest the style of the seek bar change. But what if I want a particular style for the seek bar only and keep unchanged the style of the activity? How can I see all possible precompiled styles?
Obviously, the question is for all other views also...
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 want to be able to change the action bars font and the background color. How could I go about doing this? I've searched everywhere for this and none of the options seem to work for me.
Have you taken a look at the very Sherlock website about Theming?
Theming of the action bar to work on all devices is a very
straightforward and simple process. You should follow the existing
theming recommendations for customizing the native action bar with
some minor tweaks.
And to help you with the problem, you can also use the web tool called actionbarstylegenerator.
The Android Action Bar Style Generator allows you to easily create a
simple, attractive and seamless custom action bar style for your
Android application. It will generate all necessary nine patch assets
plus associated XML drawables and styles which you can copy straight
into your project.
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.
Is it possible to use fragment tabs on action bar with the Theme.Holo.NoActionBar theme?
I mean... I already use this theme on my layouts but apparently it is overriden since the fragments have to show up in the action bar?
What I wanted to achieve is to actually get rid of the Title and App Icon over the fragment tabs. Something similar to the Google Music app.
Is this possible?
What I wanted to achieve is to actually get rid of the Title and App Icon over the fragment tabs. Something similar to the Google Music app.
Try calling setDisplayShowHomeEnabled(false) and setDisplayShowTitleEnabled(false) on your ActionBar, and leave the theme alone.
You can style the action bar based on your needs. I'm quite certain you can also remove the app icon and title from there. Using a NoActionbar theme by default and then recreating the action bar on your own kinda defeats the purpose of the action bar. I suggest you use a theme with action bar and then style the bar according to your needs. This page has a decent implementation.