android lollipop notification background colour - android

Is it possible to change the background colour of notifications in android lollipop.
I noticed that some notifications are white, some light grey and some are dark grey.
(source: gottabemobile.com)
(source: sftcdn.net)
You can see the music player notification has a dark grey background. and in the second screenshot some are light grey.
How do I set this colour? And is it possible to completely change the colour e.g. any hex code. Or can you select them from a template such as material dark material light.
Thanks for taking the time to answer

That background is set by the material design itself, it is supposed to be white, for design matters.
Take a look here!
Or you could make a custom layout.

Related

How can I use the default day/night notification background color with Samsung?

My app displays custom notifications with RemoteViews and I want them to look like the device theme. If the user has set his device to night mode, the background should be dark and if the user has set his device to day mode, the background should be white. It should use the default color of the device so it looks like the other notifications and just setting the background to #000000 would leave a white border around the notification anyway.
I use ?android:attr/textColorPrimary and ?android:attr/textColorSecondary for the text color.
I haven't set any background color and this works for all devices I've tested except for Samsung... with Samsung devices it's always a white background. In day and night mode.
Is there a style or attribute I can use for my notification background?
Min API is 19.
Edit: When I use #style/TextAppearance.Compat.Notification.Title and #style/TextAppearance.Compat.Notification for the text, the notification is readable (instead of white text on white background) but I'd like to have the right background color.
Edit2: I got my hands on a Samsung device. It looks like even Youtube wasn't able to fix this. Some of the notifications are dark though so there must be a solution.
If you have access to a physical device then just hook it up to Android Studio and use the Layout Inspector and you can find the color being used when it is in light and dark mode. Unfortunately it will only show you the color value, not the attribute, but I think you can only get the attribute with access to Samsung's source code.

How to support multiple colors (more than two color) for Android Notification icon?

I am working on Android app (API level >23). And I have to
support Notification.
And my notification icon is supported more than two colors.
If I use that icon then icon displays in grey in notification
pannel.
So I have created background transparent and completly white icon
and set color dynamically.
But I am able to set only one color (setColor()).
So my question is :-
How to support multiple colors (more than two color or color gradients) for Android Notification icon?
Note :- I have taken reference of Android Push Notifications: Icon not displaying in notification, white square shown instead
Thanks for support in advance.
If your app targets SDK 21+ the system will always tint your notification icon
white when it's displayed in a dark status bar
dark grey when it's displayed on a light status bar (API 23+)
dark grey when it's collapsed at the bottom of the notification shade
the color you set when it's part of a notification in the notification shade (API 24+, before that you'd have a white icon over a colored circle as the default large notification icon)
You have no control over the color other than what's described above.
But you can work with alpha channel. You can achieve different degrees of white/dark grey/color in your icon.
No, there's no other way. Pass this on to your designer and management.
Android 5.0 Behavior Changes
Notifications
Material design style
Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray.
Source: https://developer.android.com/about/versions/android-5.0-changes.html#NotificationsMaterialDesignStyle
Notifications
Make sure your notifications take these Android 5.0 changes into account. To learn more about designing your notifications for Android 5.0 and higher, see the notifications design guide.
Material design style
Notifications are drawn with dark text atop white (or very light) backgrounds to match the new material design widgets. Make sure that all your notifications look right with the new color scheme. If your notifications look wrong, fix them:
Use setColor() to set an accent color in a circle behind your icon image.
Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray.
from:
https://developer.android.com/about/versions/android-5.0-changes.html#NotificationsMaterialDesignStyle

How to set the window decorator color on an Android app in Chromebook?

There are many "default" apps that have the window decorator matching the app color theme such as the Youtube or Google Play apps.
My app otherwise has a gray bar (the bottom one in the pic) as most of the apps one can download from Google Play that aren't from Google.
How can I change the color of it?
The window decoration color roughly follows the status bar color. You can set it at runtime via Window#setStatusBarColor
If you do not set it specifically, the color will be derived from your theme colors.
So setting ColorPrimaryDark or ColorPrimary would define your decorations color.
The color can't be transparent, if it is, you might get the grey color you are seeing.
If you are still not seeing the right color, you are hitting a bug that should be fixed in ChromeOS 60.

How to change the EditText background Tint color in Android?

I am developing an app using Material theme. In my app, I'm having multiple edit texts to get the input from user.
I've divided the screen into two portions:
top portion background color is white background so it showing the default material theme style but
bottom portion I'm using the blue color,
If I'm using the same style in the bottom portion, EditText background tint not visible clearly. So I'm planning to change the background tint color.It supports the lollipop version. I want to show style for below versions also.
How can I do this?
Take a look at this. android.support.v4.graphics.drawable.DrawableCompat#setTint
With this you can set the tint to your EditText.
DrawableCompat

different sets of notification icons based on notification bar color

I am displaying a notification icon which is dark gray. It looks fine on Nexus One, where the notification area is light gray and is almost invisible on HTC Desire (Sense UI - dark gray notification bar). Is there a way to overcome that? (The icon cannot be changed).
Thanks a lot
EDIT: "The icon cannot be changed meaning" that I am using a custom set of icons which is a must for me.
I suggest an outline of a different color. For example this.
If that doesn't work, how about a background like this or this?
I hope this helps.
Yours,
Emmanuel

Categories

Resources