Child views added to Ti.UI.Toolbar via its "items" property will not update themselves when changing the dark/light theme on Android.
Steps to reproduce:
- Build and run the below code on Android 10 or higher.
- Tap on the "Home" button after app launches. (Do NOT back out.)
- Go to the Android system Settings -> Display screen.
- Toggle the dark/light theme switch.
- Resume the app.
- Notice app UI changed colors except for the button text color in toolbar.
- Back out of the app and then relaunch it.
- Notice the button text color in the toolbar uses the correct color.
- This is only an issue when changing theme dynamically. Backing out of the app/window and then relaunching it will show the correct colors.
- This doesn't appear to be an issue in Alloy when adding child views to toolbar via XML. I've tested for this in our kitchensink-v2 app and it works fine.
Add child views to Ti.UI.Toolbar via its add() method instead of the "items" property. However, adding views like this on iOS will have layout issues making this an Android-only solution.