Skip to content
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

Add Expo Config plugin for android colors #742

Closed
iway1 opened this issue Mar 23, 2023 · 1 comment
Closed

Add Expo Config plugin for android colors #742

iway1 opened this issue Mar 23, 2023 · 1 comment

Comments

@iway1
Copy link

iway1 commented Mar 23, 2023

Feature request

If this package included an expo config plugin for changing the date picker / time picker colors, that'd be really great because it could make it much easier for devs to change colors on Android.

Why it is needed

Changing colors for the android pickers is a massive pain (and impossible in Expo without a config plugin). With an included config plugin, this package could make it as easy as possible given the constraints of having to modify styles.xml on android to change those colors.

Possible implementation / Code Sample

app.json

{
  "plugins": [
    "@react-native-community/datetimepicker", 
    {
      "darkMode": {
         "accentColor": "#662C69",
         "textColor": "#000000"
       },
       "lightMode": {
          "accentColor": "#662C69",
          "textColor": "#662C69"
       }
    }
  ]
}

styles.xml

<resources>
  <!-- Stuff that gets added  -->
  <style name="DialogTimePicker.Theme" parent="Theme.AppCompat.Light.Dialog">
    <item name="colorAccent">#662C69</item>
    <item name="android:textColorPrimary">#662C69</item>
  </style>
  <style name="DialogTimePicker.Theme" parent="Theme.AppCompat.Dark.Dialog">
    <item name="colorAccent">#662C69</item>
    <item name="android:textColorPrimary">#000000</item>
  </style>
</resources>

Haven't tested the above styles.xml, but something like this should work and be possible

For reference: #20 (comment)

@iway1 iway1 changed the title Add Config plugin for android colors Add Expo Config plugin for android colors Mar 23, 2023
@vonovak
Copy link
Member

vonovak commented Jul 11, 2023

Hello and thanks for reporting,
I'm closing this as a duplicate of #20

please feel free to open a PR for this, or consider sponsoring the development of the package. This is on my watchlist but I have a ton of other projects and it's hard to prioritize this with the current budget: https://opencollective.com/react-native-datetimepicker
Thank you 🙂

@vonovak vonovak closed this as completed Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants