Search code examples
javaandroidimageviewdarkmode

Images change colour when i switch to dark mode in apps


My Images inside a ImageView change their color from to white when I turn on my Dark Mode.

I am putting some croppe screen shots of the images so you can understand better.

What my Images need to like(In Light Mode): enter image description here

What my image look like in dark mode

enter image description here

The black color of the Image turned into white, and white into black when I turned ON dark mode.What should I do?


Solution

  • You can use setForceDarkAllowed(false) if you don't want this View to invert colors when dark mode is enabled.

    Alternatively, you can use a different set of images for dark mode.