I'm using an actionbar with NAVIGATION_MODE_TABS set. What do you call that rectangle that appears at the bottom of the tab that is selected? And how do I customize it?
I don't know how it is called, maybe tab highlight.
Anyway, customize it with the Android Action Bar Style Generator.
Related
I'm using new Navigation Component in my project. I created a custom Toolbar which will keep the Title in the centre even when having navigation drawer.
This is how my toolbar looks now.
I'm trying to put a custom hamburger and back icon there(basically i need white icons).
I've tried
dataBinding.appBarHome.toolbar.setNavigationIcon(ContextCompat.getDrawable(this, R.drawable.ic_hamburger));
getSupportActionBar().setHomeAsUpIndicator(ContextCompat.getDrawable(this,R.drawable.ic_hamburger));
None of it is working. if want to see any specific part of my code, feel free to ask.
Maybe it just because of style or them,
Just try with bellow style
ThemeOverlay.AppCompat.Dark.ActionBar
When every you choose dark action bar then default icon color should be white and when you select an action bar then it will be the black icon
So just replace style in your manifest or style.xml
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 customize navigation drawer app compact action bar, I want to remove app icon from that and want to make its title center in action bar.
I have applied all solutions , but nothing is working with all the conditions.
Please give me some clue for applying it correctly
You should creat a customize action bar. Then, if you want you can add a button that can open and close your drawerlayout.
I have solved my problem. As mentioned, I have two problems, and I solved that in following way :
1) For making title centre, we need to make custom layout of action bar, and need to remove action bar title.
2) for remove app icon from action bar, we need to set android:icon property of that activity in manifest with transparent image or colour.
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.
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.