Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notification with inverted color with dark mode

On android 10, negative images i.e images with inverted color are displayed in the notification from custom-notification apps when dark mode is enabled.

How to prevent that from happening?

Notification with light theme:

image1

Notification with Dark theme:

image2

like image 625
Nik Avatar asked Jan 25 '20 15:01

Nik


People also ask

Does dark mode invert colors?

You can change your display to a dark background using a dark theme or color inversion. Dark theme applies to the Android system UI and supported apps. Colors don't change in media, such as videos. Color inversion applies to everything on your device, including media.

How do I get notifications in dark mode?

Use the system setting (Settings -> Display -> Theme) to enable Dark theme. Use the Quick Settings tile to switch themes from the notification tray (once enabled). On Pixel devices, selecting the Battery Saver mode enables Dark theme at the same time.

Why is Google white in dark mode?

My Google Chrome app has Dark Mode enabled but Google search results is still a bright white screen. It is possible that the cause is outside of Google Search, and a Chrome extension is blocking this result. Or there is a conflict with the settings.


1 Answers

It turns out this was an android issue, which is fixed after moving to androidx and setting targetsdk to 29 or above. And to add support for dark mode, we can add the desired color to both the files, color.xml(night) and color.xml(not-night).

like image 71
Nik Avatar answered Sep 18 '22 14:09

Nik