In my application i have to change the navigation drawer same as Action bar's which is light now How i can change the navigation drawer theme to light by default it is dark?? I search for this but didn't find anything satisfying.
change background color of your list view or change theme of your list-view raw theme
Related
I use White Action Bar and i want to use black color icons to Open Navigation drawer and more options button?
I tried using a White Action Bar but i end up getting all the icons or the buttons to be invisible in the Action bar since they are also in white color.
Kindly suggest how can i set color to the Action bar elements, as of now i want to display black icons on the Action bar with shadow.
Voila! I have found the answer.
Just Replace the code in styles.xml
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Light" />
Note: When u use a Light theme, it is understood that you will use only light colours in the action bar and therefore the colour of the text and icons are made dark(black).
Thank me later!
I'm try to developing an app with a navigation drawer from a template found on github.
In style.xml i have:
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#ff0000</item>
<item name="colorPrimaryDark">#0000ff</item>
and the status bar in navigation drawer is ok.
When i click the button it runs this command:
getWindow().setStatusBarColor(Color.GREEN);
Now the status bar color in navigation drawer is no more translucent
How restore status bar color to translucent?
The difference is that the xml defined colors colorPrimary and colorPrimaryDark are not really used to directly set the status bar color.
Actually the statusbar is completely transparent all the time and only the underlaying View is colored. Thats why it can have another color on the left than on the right side (have a look at your second screenshot). If you now call getWindow().setStatusBarColor(..) you indeed color the statusbar directly and over-draw the color of both Views. So it needs to stay transparent!
What you really want to do, is changing the color of the View underlaying the status bar, which is done with the ScrimInsetsFrameLayout class.
Have a look at this question and this class from the library you provided
There you should find all the necessary information to change only the color of the area you want to.
In case you really just want to reset the color:
getWindow().setStatusBarColor(Color.TRANSPARENT);
I am using appCompat v21 and I want to change color of actionbar to black while actionbar tabs should be white. Setting colorPrimary changes colors of both actionbar and tabs. I have tried setting theme to light and then using actionBarStyle with black background but this apparently doesnt work in appcompat v21.
What is the best way to accomplish this? Thanks in forward
I am applying a style in my Android app where the main colour is the orange. So I would like to set up a theme where the main colour is orange instead of the blue one in Holo theme. Is there a way to change globally the theme colours?
For example, I would like to change the drawable which is applied while pressing the ActionBarDrawerToggle. How could I change that drawable? And the one with the caret pressed to go to a parent activity?
I am developing an Android app for Level 10 API and using Support Library v7.
Thanks in advance.
You can use a tool such as Android Action Bar Style Generator to change the coloring of the action bar and the accent color used for touch highlighting (although note the Kitkat styling is light gray touch highlighting rather than colored highlighting).
Similarly, for the Navigation Drawer icon itself you can use the Navigation Drawer Indicator Generator to colorize the drawer itself, although generally you should consider coloring the Action Bar with your primary color and using the default holo light/dark for icons.
I've recently implemented a navigation drawer in an app that I'm working on, and I've noticed it hasn't taken on my app theme Holo.Light.DarkActionBar. Shouldn't the nav drawer have the same style as this theme, which would be that light-gray background and dark gray text? Currently it has a black background with white text. How would I go about having my navigation drawer's theme consistent with the rest of the app? I don't think I can set the theme/style to the layout of the drawer nor can I do it programatically. Is this something I must do manually? If so, does anyone know the hex values for the dark gray text and light-gray background, as I can't seem to access the default resource that contains these values.
You have to theme the navigation drawer manually, it doesn't inherit the parent theme. Here's a question that contains a list of all the Holo colors: What are the default color values for the Holo theme on Android 4.0?