-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to change menu theme on android #78
Comments
All depends on what the upstream menu library allows |
was asking this as well, did you find out how to implement this? |
i would really like to switch menu components for android… |
Somewhat, I just created some plugins to edit the style via the android xml files when the project is built. The two plugins I use are here, there is one for editing the style.xml file to change the text Color and also to point to the background style overwrite. Then there is a plug-in to add a drawable xml with the popup menus overwrited style. It's not super easy to understand, but generally if you copy the plugins you should only need to edit the drawable one and change the values as needed. (You'll also need to add the plugins to your app.json to make them run when it's built) https://github.com/Cleover/Mebious/tree/main/plugins |
thanks for this, will try it out, does it work based on device theme? |
The plugins I made only edits the light mode script, however it's possible to have separate light/dark colors by using another xml file. I'm not 100% sure of the best way to do it but I'd check out this docs page: https://docs.expo.dev/config-plugins/plugins-and-mods/#create-a-plugin I know you can make a styles.xml file inside of a dark mode directory in a similar place to where the other files are, and that file can have its own style for when in dark mode. However there are also mods.android.colors and mods.android.colorsNight which makes me think you may be able to have the app pull the Colors from there instead without needing to have a separate overriding menu theme applied depending on the device theme, but I'm not sure on how they work enough to say for sure which way is best. |
I'm working on implementing Zeego for the first time and this Android color mode issue is my main blocker. @Cleover it's been a few weeks, how is your plugin approach working? My app follows the user's system color scheme, so I need the Android menu to follow this behavior too. Not sure I want to go down the rabbit hole with multiple plugin customizations. |
https://developer.android.com/develop/ui/views/components/menus
https://developer.android.com/develop/ui/views/theming/themes
Unsure how extensive this is, but it would be nice to be able to change the background / text colour.
I’m unsure if this is considered native but is it possible to round the edges of android menus?
https://stackoverflow.com/questions/53964594/how-do-i-make-the-rounded-corners-of-the-menu-in-the-toolbar
Is it possible to force a theme on iOS (for dark/light) rather than defaulting to the system?
Should dividers be visible on android? As far as I can tell they do exist on android but the DropdownMenu’s item groups don’t seem to have the separator.
'Cheers
The text was updated successfully, but these errors were encountered: