Background for notification icons - android

I am trying to figure out why different icons in the notification area have different backgrounds.
Please see attached screenshot. 'USB debugging conencted' has a solid color background, but other two notification icons don't have the same greenish background. In my app, notifications generated from two different places similarly have different backgrounds. And.. the icons used are similar - there's no solid vs transparent difference in them, the code is standard and simple - setSmallIcon(). As such, there's no indication why system would treat the icons differently.
This is a very fine detail, and I haven't been able to find any answers anywhere else. I have finally turned to the experts here. Does anyone have any idea?

This is based on Notification priority. Notifications with PRIORITY_MIN have the 'dark' background like 'Time to Work' notification in the screenshot. Those with PRIORITY_HIGH (and I think PRIORITY_MAX too) have the greenish background.

Related

Notification icons are cut in half in SystemUI with status bar padding (Android Pie)

I'm trying to solve a problem with SystemUI's dimens.xml on my Pie-based ROM (it happens on stock as well).
Currently, when a notification arrives, it looks like
this (the notification icon is basically cropped from the left side).
The only thing that solves it is reducing rounded_corner_content_padding and status_bar_padding_start in SystemUI's dimens.xml. However, this also pushes the status bar edges way too close to the screen borders, which doesn't look pretty.
Is it possible to get rid of this part of the notification altogether? It seems redundant considering there are heads-up notifications already.
I've also stumped upon this problem recently. After digging through the frameworks/base source code, I believe that it is a bug in the AOSP upstream, that rounded_corner_content_padding is not accounted for in HeadsUpStatusBarView, causing the layout function to behave incorrectly. I've tried to fix this and submitted a patch to AOSP,
https://android-review.googlesource.com/c/platform/frameworks/base/+/964275
where you can find a more detailed description and download the patch to apply to your own ROM.
Of course, I am not sure whether this is really a bug in AOSP or just a problem on my side -- this has to be reviewed by the AOSP development team.

Push notification white square icon

I'm using pushwoosh for push notification service.
according to the Android documentation I've used a white icon for notification.
but on some devices, I see white square again.
on other hand,s I've used a colored icon and I see the colored notification.
why on some devices I can use a colored icon, and on other, I always see the white icon?
Depending on the OS version it happens.You may have observed it is only happening in low version of OS's like jellybean,kitkat.
I don't think this will happen in lollipop or marshmallow and above OS versions.
You should follow the Guidelines for icon designing, otherwise it will be in white box for some Android versions. You can look here https://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar. Based on this you should use .png image and only white and grey color for icons.

White square icon in tool bar

I read in almost every question that I have to make the app icon transparent, and I did that. However, It still shows up as a white square, but when I pull the notification menu down i see the notification in colors.
At this point, I made separate icons that I designed differently and added them under drawable folders. How do I add them to be used by the push notifications when received?
Extremely confused about this topic. Note: I am using React-Native to build this android app.
That's how it is supposed to behave after Lollipop I believe.
In the status bar the icon is just a white tinted version of your icon. When you pull the notification bar, it shows normally.
You need to use a notification icon with just the logo, with no solid background.
Check What's App's icon for example to see what I mean.

Force Android to show all copies of identical notification icons

My app can accept multiple client connections and I want it to display a status bar icon for each connection with a little indicator to show activity from this client.
If I have two clients connected, for example, I would like to show two status bar icons that each indicate a client's state.
Right now I'm using standard Notifications for this for which I update the iconLevel as needed.
Everything works great on my Ice Cream Sandwhich phone, but my Lollipop tablet removes all but one of the icons whenever they all show the same state, e.g. when both clients are idle. If one client is idle and the other one has activity, i.e. the two icons are not the same, then both icons are shown. Also, if I open the tray, both notifications always show up, whether or not they show the same icon.
Is there a way to prevent this duplicate-icon-collapse?
I guess I could use a different set of images that all look (almost?) the same for each icon, but I'm hoping for a more elegant solution...
Turns out the hack-job solution I wanted to avoid isn't that bad after all:
I don't need to ship different versions of my images, or even multiple identical copies of them. It's sufficient to have multiple copies of the xml-file that defines the LevelListDrawable and then use a different one for each icon. It is ok for all LevelListDrawables to reference the same image files.
In other words: Status bar icons only ever get collapsed (on some platforms) if the resource IDs for their icons and their iconLevels are identical.
This is still a pretty ugly solution, so I definitely won't accept this as the final answer. Hopefully there is a cleaner way to do this.

How to Show Status Bar Icons on the Right like Betternet?

Before you flag this as duplicate, I researched this question a long time ago and found this and this, which both suggest that the right side of the notification bar is a system apps ONLY zone.
However, I recently used Betternet and after connecting to the VPN, these two icons appear:
Betternet is not a system app, and my HTC On3 M8 is not rooted. How did they do it?
The left icon is a Notification. These can be displayed by any app.
The right icon is a standard icon, added there by Android, indicating an active VPN connection. These are not put there by apps directly, though certain things that apps implement (e.g., VpnService) might result in an icon being shown there.

Categories

Resources