mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Add TimePicker modes
Summary: In the spirit of #10932, I added the `mode` option to the `TimePicker` Android API. There is only one mode available for **Android < 5**, the `spinner` one. If we are on **Android >= 5** we can choose between `spinner` or `clock`. If we specify `default` it will use the default of the current Android version. On **Android < 5**, whatever we choose it will be this:  On **Android >= 5**, with the `spinner` mode:  And with the `clock` mode, the default:  Closes https://github.com/facebook/react-native/pull/12384 Differential Revision: D6006689 Pulled By: hramos fbshipit-source-id: fcd37c867c4061b9982b1687f2c10211e54df7cf
This commit is contained in:
committed by
Facebook Github Bot
parent
f9be64aea0
commit
1c24440644
@@ -44,6 +44,10 @@ class TimePickerAndroid {
|
||||
* * `is24Hour` (boolean) - If `true`, the picker uses the 24-hour format. If `false`,
|
||||
* the picker shows an AM/PM chooser. If undefined, the default for the current locale
|
||||
* is used.
|
||||
* * `mode` (`enum('clock', 'spinner', 'default')`) - set the time picker mode
|
||||
* - 'clock': Show a time picker in clock mode.
|
||||
* - 'spinner': Show a time picker in spinner mode.
|
||||
* - 'default': Show a default time picker based on Android versions.
|
||||
*
|
||||
* Returns a Promise which will be invoked an object containing `action`, `hour` (0-23),
|
||||
* `minute` (0-59) if the user picked a time. If the user dismissed the dialog, the Promise will
|
||||
|
||||
Reference in New Issue
Block a user