In Lollipop we can change the color of status bar background or even make it transparent. Let's suppose I want a light background (#eee). Status bar icons' default color is white, so they would become illegible. Is it possible to make them dark?
It's now possible in Android 6+ using this attr in style.xml:
<item name="android:windowLightStatusBar">true</item>
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!
Can I prevent the colour of the status bar becoming colorPrimary? I mean, I do not want to change the status bar colour, and leave it as it is (system default). I have searched Google for this, and the answer was hiding the status bar. But I do not want to hide it.
I also do not want to change the primary colour to that of the default colour of the status bar. I need the primary colour as it is for other things. I just do not want it to be applied to the status bar.
I know that was the default behaviour before Lollipop. Is this still possible after Lollipop?
This should work
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:statusBarColor">#000000</item>
</style>
In your application theme, set status bar color as below:
<item name="statusBarColor">"YOUR_COLOUR_CODE"</item>
I want to set the color of status bar to white and icons such as wifi and battery to black. How can I do this?. I will prefer to do this via using Theme.AppCompat
The color of the status bar can be changed by :
<item name="colorPrimaryDark">your_required_color</item>
From API 21, to change color of status bar without using "colorPrimaryDark" use:
<item name="android:statusBarColor">your_required_color</item>
Since Lollipop. Starting with Android 5.0, the guidelines say:
Notification icons must be entirely white.
Even if they're not, the system will only consider the alpha channel of your icon, rendering them white
Refer this : Android statusbar icons color
But from API 23, to change system status icons to semitransparent black you can use :
<item name="android:windowLightStatusBar">true</item>
Refer this : https://plus.google.com/+RomanNurik/posts/4WBSonAZxt1
You can change your statusBarColor by typing below attribute in your style.xml you need to input this code in your base theme.
<item name="android:statusBarColor">COLOR THAT YOU WANT TO CHANGE</item>
I have searched a lot about this but all I have found is how to change status bar color.
I want to invert color of icons in status bar on white background like Soundcloud has done in its mobile application like:
How to do this?
You can do that with the following code. it's just working on v23 API.
In your: values-v23/styles.xml:
<item name="android:windowLightStatusBar">true</item>
Check this link for more information: https://stackoverflow.com/a/30075921/4409113
Or: https://stackoverflow.com/a/33316669/4409113
I had changed Action Bar color with this code: getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#0067ad")));
But when I hold Home button there Action Bar Color is Black.
How I can change it!
Thanks!
You'd better set color of Actionbar in styles-v21.xml like following:
<item name="android:colorPrimary">#color/yourActionbarColor</item>
colorPrimary determines the color of Actionbar and app's header in recents. In styles.xml focused on pre-L versions, you should use name="colorPrimary" to get same result.
And if you only want to change header color shown in recents above Lollipop, you can use following java code:
TaskDescription taskDesc = new TaskDescription(yourTitle, yourIcon, yourColor);
myActivity.setTaskDescription(taskDesc);