mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
9ff090e507
Summary: In this diff we integrate the Picker component on Android in Fabric. Since both AndroidDropdownPickerNativeComponent and AndroidDialogPickerNativeComponent use `style?: ?TextStyleProp`, which is not supported by the JS codegen, I had to handwrite the C++ files and check them in. The component is not fully functional yet because `setNativeProps` is not supported in Fabric. I will fix this in the next diff. Changelog: [Android] [Added] - Integrate Picker into Fabric on Android Reviewed By: mdvacca Differential Revision: D17954435 fbshipit-source-id: 6b7b029ab0c84c27a48c7dddd66878c9dea324bf
29 lines
976 B
C++
29 lines
976 B
C++
/*
|
|
* 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.
|
|
*/
|
|
|
|
#include "AndroidDropdownPickerProps.h"
|
|
|
|
#include <react/components/image/conversions.h>
|
|
#include <react/core/propsConversions.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
AndroidDropdownPickerProps::AndroidDropdownPickerProps(
|
|
const AndroidDropdownPickerProps &sourceProps,
|
|
const RawProps &rawProps)
|
|
: ViewProps(sourceProps, rawProps),
|
|
color(convertRawProp(rawProps, "color", sourceProps.color, {})),
|
|
enabled(convertRawProp(rawProps, "enabled", sourceProps.enabled, {true})),
|
|
items(convertRawProp(rawProps, "items", sourceProps.items, {})),
|
|
prompt(convertRawProp(rawProps, "prompt", sourceProps.prompt, {""})),
|
|
selected(
|
|
convertRawProp(rawProps, "selected", sourceProps.selected, {0})) {}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|