I'm trying to change the color of the on screen button bar:
I've managed to change the status bar color via the Android Manifest like this:
android:theme="#style/Theme.WebViewApp.Gray"
However I can't seem to figure out how to change from this purple color.
This section of screen called NavigationBar:
You can change color of NavigationBar using: http://developer.android.com/reference/android/view/Window.html#setNavigationBarColor(int)
This Method won't work on API version < 21.
To change navigation bar icon colors you can use the following answers: Change navigation bar icon color on Android
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'm wondering how to change the StatusBar color dependent on the current active Fragment (on 5.0 Lollipop). Currently, I change the ActionBar color dependent on the Fragment I am in, but now I want the StatusBar color to change as well - in order to look nice on Lollipop devices.
I've tried using setStyle to programmatically change the theme depending on the fragment, but it doesn't seem to be changing the status bar color.
Any ideas would be appreciated!
Have you tried to change the color of the status bar using Window.setStatusBarColor? For example, you can do the following to change the status bar color to red programmatically.
getWindow().setStatusBarColor(Color.RED);
The documentation of setStatusBarColor can be found here. You can also read the documentation on how to Customize the Status Bar.
Note: This method only works at Lollipop or above.
If you are seeing an unexpected color, make sure the integer value you are passing is a color integer and not a resource ID.
getWindow().setStatusBarColor(getResources().getColor(R.color.custom_color)); // RIGHT
getWindow().setStatusBarColor(R.color.custom_color); // WRONG
I have an Android app which allows the user to change the color of a background based on the selection they choose.
This is the line that changes the color:
appBackground.setBackgroundColor(Color.rgb(inRed, inGreen, inBlue));
How do I also change the menu bar color as well the notification bar to change to that color of the user's choice?
I know it's only possible in KitKat but can someone point me to the way...
If you would like an effect like the image below, have a look here:
Why can't we use a Translucent system bars with and ActionBar
As you can see, the background color can be changed programatically (so it's not defined in the xml).
I have a menu in the Action bar of my tablet. In my style i puted Android TextColor white. but I would like to remove the click Action of my Item so I tried item.setEnabled(false); but the problem with this command that my text will be in grey not in white.
Android puts the color to gray to make it clear to the user that it's not enabled. If you really want it to stay white, don't use setEnebled(false) but just don't handle the click event.
I am using the ActionBarCompat sample. If our action bar has a dark background, we want to use white-colored icons. But these icons are also used for the system menu items (when they don't fit on the action bar, pre-honeycomb). So the white icons aren't visible on the system menu white background. Example:
What can we do about this? Is there a way to use the dark version of icons when shown on the system menu, and light colored when on the action bar?
Thanks
There are only two ways to handle this issue. Either change the color of your ActionBar, or edit the color of your icons.
I would suggest that best combination for Actionbar and icons would be Red color for Actionbar and white color for your icons.
And how can white icons be visible in white background??? If you remember in Menu icons we have grey background with white icons. That's why they are easily visible in Menu's.