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

Android datetime picker change colors? #29

Closed
rendomnet opened this issue Apr 9, 2017 · 12 comments
Closed

Android datetime picker change colors? #29

rendomnet opened this issue Apr 9, 2017 · 12 comments
Labels

Comments

@rendomnet
Copy link

Can we change colors of Android datetime picker?

@mmazzarolo
Copy link
Owner

Hi there,
to style it on Android you should tweak a bit the native code :)

@bennygenel
Copy link

bennygenel commented Apr 14, 2017

Hi @mmazzarolo;
I have sort of a problem about this. I changed colors on my theme on native code but it doesn't change your dialogs. If I use react-native DatePickerAndroid and TimePickerAndroid separately it works perfectly but doesn't change when I use yours.

Here is my style.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorAccent">@color/mainRed</item>
    </style>
    <style name="Dialog.Theme" parent="Theme.AppCompat.Light.Dialog">
        <item name="colorAccent">@color/mainRed</item>
    </style>

</resources>

Edit: I found out that if I set react-native DatePickerAndroid mode it doesn't work either. If I don't pass a mode prop it works fine.

What do you think can cause this?

Thanks

@mmazzarolo mmazzarolo reopened this Apr 14, 2017
@mmazzarolo
Copy link
Owner

mmazzarolo commented Apr 17, 2017

Hey @bennygenel,

I found out that if I set react-native DatePickerAndroid mode it doesn't work either. If I don't pass a mode prop it works fine.

If you're talking about react-native's own DatePickerAndroid, it is a react-native issue indeed.
Do you mind opening an issue on the react-native official repo?
Feel free to link this issue if needed, I'll leave it open :)
Thank you!

@bennygenel
Copy link

Hey @mmazzarolo;

Thanks for reopening the issue. I was wondering if it is possible to not provide a mode prop to the DatePickerAndroid if the datePickerModeAndroid prop is omited?

At least this way default DatePickerDialog can be styled correctly.

Thanks again

@mmazzarolo
Copy link
Owner

mmazzarolo commented Apr 17, 2017

Could you submit a PR (making sure that it doesn't break anything)?
I'll gladly merge it, but I'd also like to see the issue reported to the react-native official repo (I can do it by myself when I have some spare time if you can't do it!).

Thanks! 👍

@lixiaobin0303
Copy link

Android to get the date is not correct bad day

@mmazzarolo
Copy link
Owner

Closing for inactivity, feel free to post here if you want to discuss this subject further and I'll re-open it! 👨‍💻

@bsonntag
Copy link
Contributor

bsonntag commented Jul 4, 2017

Passing datePickerModeAndroid={'default'} fixes the issue.
@mmazzarolo maybe this should be the default value instead of 'calendar'. What was the reason for using 'calendar' as the default value for this prop?

@mmazzarolo
Copy link
Owner

@bsonntag thank you for investigating on the issue.
Honestly, that prop comes from a previous PR, so I can't really answer your question.
Would you mind submitting a PR for fixing it? :)

@bsonntag
Copy link
Contributor

bsonntag commented Jul 4, 2017

@mmazzarolo done 😉

@annedevia
Copy link

what should i write on onConfirm function when i have 2 inputfields for date picker? please help me

@animeclover
Copy link

I try the below blog for adding datePickerAndroid and it's working fine also provide when a user has multiple input field for date solution.

https://infinitbility.com/how-to-add-datepickerandroid-in-react-native-with-color-changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants