forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AndroidDropdownPicker and AndroidDialogPicker (facebook#22999)
Summary: Changelog: ---------- [Android] [Changed] - As mentioned in facebook#22990, I have moved native components required by PickerAndroid.android.js into separate files and added Flow Typing. Pull Request resolved: facebook#22999 Differential Revision: D13697130 Pulled By: TheSavior fbshipit-source-id: 42da73d82cca45fefa066871eed5a637811643c8
- Loading branch information
1 parent
ed4e78d
commit afee17e
Showing
3 changed files
with
99 additions
and
5 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
Libraries/Components/Picker/AndroidDialogPickerNativeComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const requireNativeComponent = require('requireNativeComponent'); | ||
|
||
import type {SyntheticEvent} from 'CoreEventTypes'; | ||
import type {TextStyleProp} from 'StyleSheet'; | ||
import type {NativeComponent} from 'ReactNative'; | ||
|
||
type PickerAndroidChangeEvent = SyntheticEvent< | ||
$ReadOnly<{| | ||
position: number, | ||
|}>, | ||
>; | ||
|
||
type Item = $ReadOnly<{| | ||
label: string, | ||
value: ?(number | string), | ||
color?: ?number, | ||
|}>; | ||
|
||
type NativeProps = $ReadOnly<{| | ||
enabled?: ?boolean, | ||
items: $ReadOnlyArray<Item>, | ||
mode?: ?('dialog' | 'dropdown'), | ||
onSelect?: (event: PickerAndroidChangeEvent) => void, | ||
selected: number, | ||
prompt?: ?string, | ||
testID?: string, | ||
style?: ?TextStyleProp, | ||
accessibilityLabel?: ?string, | ||
|}>; | ||
|
||
type DialogPickerNativeType = Class<NativeComponent<NativeProps>>; | ||
|
||
module.exports = ((requireNativeComponent( | ||
'AndroidDialogPicker', | ||
): any): DialogPickerNativeType); |
47 changes: 47 additions & 0 deletions
47
Libraries/Components/Picker/AndroidDropdownPickerNativeComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const requireNativeComponent = require('requireNativeComponent'); | ||
|
||
import type {SyntheticEvent} from 'CoreEventTypes'; | ||
import type {TextStyleProp} from 'StyleSheet'; | ||
import type {NativeComponent} from 'ReactNative'; | ||
|
||
type PickerAndroidChangeEvent = SyntheticEvent< | ||
$ReadOnly<{| | ||
position: number, | ||
|}>, | ||
>; | ||
|
||
type Item = $ReadOnly<{| | ||
label: string, | ||
value: ?(number | string), | ||
color?: ?number, | ||
|}>; | ||
|
||
type NativeProps = $ReadOnly<{| | ||
enabled?: ?boolean, | ||
items: $ReadOnlyArray<Item>, | ||
mode?: ?('dialog' | 'dropdown'), | ||
onSelect?: (event: PickerAndroidChangeEvent) => void, | ||
selected: number, | ||
prompt?: ?string, | ||
testID?: string, | ||
style?: ?TextStyleProp, | ||
accessibilityLabel?: ?string, | ||
|}>; | ||
|
||
type DropdownPickerNativeType = Class<NativeComponent<NativeProps>>; | ||
|
||
module.exports = ((requireNativeComponent( | ||
'AndroidDropdownPicker', | ||
): any): DropdownPickerNativeType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters