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...
Related
I want to make android custom app bar that contains searchbox, icon, etc.
The solution on google that I found was changing the style to no action bar. And create a toolbar layout that need to be included in every activity I made.
I just wondering, can I make custom App bar that default appear in every activity without including them when creating Activity?
I would recommend using v7.widget.toolbar. At first you need to create custom layout for your toolbar. Then you need to set it as a support action bar in each activity that you want it to appear. Toolbar on every activity can contains different icons.
https://developer.android.com/training/appbar/setting-up.html
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 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.
I'm trying to achieve the effect shown here: http://www.youtube.com/watch?v=6QHkv-bSlds&t=15m48s by Nick and the boys. I can get the action bar to be overlayed, but cannot figure out how to extend this to the status bar. I would also like to know how they managed the transparent black background behind the navigation bar (but this isn't as crucial).
Any help / advice would be greatly appreciated as I currently have no idea how this is done (and am starting to worry it may just be an image rather than an actual implementation).
Edit: i know how to make the bars fully transparent (thats the easy part)! I dont know how to extend the actionbar background to appear behind the now transluscent status bar
I had the same question and found this library: https://github.com/jgilfelt/SystemBarTint
Have a look at line 300 in:
https://github.com/jgilfelt/SystemBarTint/blob/master/library/src/com/readystatesoftware/systembartint/SystemBarTintManager.java
setupStatusBarView() Adds a view to the window's decor. This allows you to later set a color/drawable to this view.
If using the SystemBarTint library, the following will allow you to force the status bar to a specified color, which you can then match to your action bar's background:
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintColor(Color.parseColor("#DD000000"));
In this case you would set your action bar's background to: #DD000000
As described in the Android 4.4 APIs:
You can now make the system bars partially translucent with new themes, Theme.Holo.NoActionBar.TranslucentDecor and Theme.Holo.Light.NoActionBar.TranslucentDecor. By enabling translucent system bars, your layout will fill the area behind the system bars, so you must also enable fitsSystemWindows for the portion of your layout that should not be covered by the system bars.
If you're creating a custom theme, set one of these themes as the parent theme or include the windowTranslucentNavigation and windowTranslucentStatus style properties in your theme.
In your case (where you want the ActionBar), the second option - including the two new properties into your theme - will give you a translucent Navigation and Status bar.
They are using the new Translucent system bars feature (on Android 4.4 and up).
Translucent system bars
You can now make the system bars partially translucent with new
themes, Theme.Holo.NoActionBar.TranslucentDecor and
Theme.Holo.Light.NoActionBar.TranslucentDecor. By enabling translucent
system bars, your layout will fill the area behind the system bars, so
you must also enable fitsSystemWindows for the portion of your layout
that should not be covered by the system bars.
If you're creating a custom theme, set one of these themes as the
parent theme or include the windowTranslucentNavigation and
windowTranslucentStatus style properties in your theme.
I want to have a GUI kindof like how Market is. Mainly I want a title with an icon and the name. So I've disabled the default titlebar and are using a 9 patch image as my custom titlebar. It looks great, but the top system bar ( cannot remember what's it called atm ) is casting a shadow on my application - specifically on my titlebar. I've looked at the Market's custom titlebar and it doesn't have a shadow, or the shadow is below the three main buttons casting on the contentlist.
How can I remove the shadow from my custom titlebar, and maybe have it below - casting on the content?
The short answer to this is that the title bar is a part of the theme and that one have to make changes to the current theme and set a custom layout for the title bar. More info here: http://www.anddev.org/my_own_titlebar_backbutton_like_on_the_iphone-t4591.html