Customize Android AppTheme
Adam Perry
"Is there any way to customize the android
AppTheme
without detaching and editing _styles.xml_ directly?If it's not currently possible, it would be cool if we could set
colorPrimary
, colorPrimaryDark
, colorControlActivated
, colorAccent
, etc. through _app.json_."Christopher Lugod
any update with this?
Michael Wood
Christopher Lugod: Have a look at the following:
https://github.com/search?q=org%3Aexpo%20withAndroidStyles&type=code
I wrote the following code for setting the
colorEdgeEffect
in styles.xml
a couple of years ago, so check the above Expo code to see if there are better ways of doing things, but I think it should still be useful:https://github.com/wodin/rn-hce-test/blob/395c1870acb9b9fbaec8349132af92d910a4d17d/plugins/withAndroidColorEdgeEffect.js
https://github.com/wodin/rn-hce-test/blob/395c1870acb9b9fbaec8349132af92d910a4d17d/app.json#L45-L50
See also:
https://www.npmjs.com/package/xml2js#xml-builder-usage
Michael Wood
Editing
styles.xml
should be pretty straightforward with a Config Plugin.carlos3g
up
Omar Awwad
Any update?
Sébastien Lorber
Hi,
Would this feature request allow to customize the TimePickerAndroid theme color?
Matthew Pace
Bumping this feature request. Would like to be able to style this datetime component: https://github.com/mmazzarolo/react-native-modal-datetime-picker
Panagis Alisandratos
Any chance of this being introduced in SDK 20 or 21?
Adam Perry
For clarification, this is only likely to be possible for standalone apps in the near future.
Sébastien Lorber
Adam Perry: can't this be handled by defining colors in app.json? So that your build service generate the appropriate xml config files?