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
Related
I want to create my own Android app and my problem is that I can only see a charging icon in the status bar instead of battery, time, wifi etc.
Above you can see how it looks, but there is not much to see.
In styles.xml I chose this Theme:
style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar
If you need more information just ask.
I found out that my status bar was white because the colorPrimaryDark in colors.xml was white. And normally the status bar has the color of PrimaryDark.
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 change the action bar color and text color as in Instagram. Because when I make a gray color, the icon and the time are not clear.
try using this code,
<style name="statusBarStyle" parent="#android:style/Theme.DeviceDefault.Light">
<item name="android:statusBarColor">#color/status_bar_color</item>
<item name="android:windowLightStatusBar">false</item>
its not my code and i got this from here.
According to the guidelines, Starting with Android 5.0 all Notification icons must be entirely white.
The only way to have a colored icon is to lower your targetSdkVersion to values <21, but I think you would do better to follow the guidelines and use white icons only.
If you still however decide you want colored icons, you could use the DrawableCompat.setTint method from the new v4 support library.
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>
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>