icon-menu-item with monochrome icons that work on all devices (black-on-white vs white-on-black)

Some devices have menu2 that has white background and black text (fenix6) and others have black background and white text (fr955). I'd like to use icon-menu-item with monochrome svg icons (i.e: https://www.svgrepo.com/svg/448413/exit-point ) Is there a way to add them to drawables.xml in such a way that they "automatically" become white-on-black or black-on-white depending on the menu2 colors of the device?

  • OK, so maybe there isn't some nice solution, like tint in the drawables.xml... But is there a at least way I can know which device's Menu2, IconMenuItem is black-on-white an which is white-on-black? I looked in simulator.json, but couldn't find it.

  • For the meantime this is my lazy solution: I didn't want to manually map each device to see the background of Menu2 (not to talk about whether such collection made in the simulator would really represent the real devices?) so for now I made this ugly workaround: I change the black color to #777777 this way it is mapped to a color that exists on each device (I didn't try on monochrome devices, 'cause it's not relevant to my app) and can be seen (according to the few I tested in the sim). Note that if you don't support the devices that only have 8 colors (fr45, fr55, garminswim2) then you can chose a "higher" gray, but if you use any of these devices then if you go higher then it will be mapped to white and it won't be visible on the white background.

    My drawables look like this:

    <bitmap id="exit" filename="logout.svg" automaticPalette="true" dithering="none" scaleX="15%" scaleRelativeTo="screen" />
    but I'm not sure if this is the best setting in terms of automaticPalette and dithering.