From 858efb222ecbdac2d9b30d0750f39a552a7b2d5b Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Sat, 2 Mar 2019 12:52:45 -0800 Subject: [PATCH] Use Generated ActivityIndicatorView Schema Summary: We are now generating the native cpp files for ActivityIndicatorView via Buck. Deleting the hand written files and switching over. Reviewed By: TheSavior Differential Revision: D14247446 fbshipit-source-id: 63a6df3254e4184de6c8abb9ea2c89654ad54398 --- .../ActivityIndicatorSchema.js | 91 +++++++++++++++++++ .../RCTActivityIndicatorViewComponentView.mm | 5 +- 2 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 Libraries/Components/ActivityIndicator/ActivityIndicatorSchema.js diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicatorSchema.js b/Libraries/Components/ActivityIndicator/ActivityIndicatorSchema.js new file mode 100644 index 000000000..d68552d7b --- /dev/null +++ b/Libraries/Components/ActivityIndicator/ActivityIndicatorSchema.js @@ -0,0 +1,91 @@ +/** + * 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'; + +import type {SchemaType} from '../../../packages/react-native-codegen/src/CodegenSchema.js'; + +const SwitchSchema: SchemaType = { + modules: { + ActivityIndicatorSchema: { + components: { + ActivityIndicatorView: { + extendsProps: [ + { + type: 'ReactNativeBuiltInType', + knownTypeName: 'ReactNativeCoreViewProps', + }, + ], + events: [], + props: [ + { + name: 'hidesWhenStopped', + optional: true, + typeAnnotation: { + type: 'BooleanTypeAnnotation', + default: false, + }, + }, + { + name: 'animating', + optional: true, + typeAnnotation: { + type: 'BooleanTypeAnnotation', + default: false, + }, + }, + { + name: 'styleAttr', + optional: true, + typeAnnotation: { + type: 'StringTypeAnnotation', + default: '', + }, + }, + { + name: 'color', + optional: true, + typeAnnotation: { + type: 'NativePrimitiveTypeAnnotation', + name: 'ColorPrimitive', + }, + }, + { + name: 'size', + optional: true, + typeAnnotation: { + type: 'StringEnumTypeAnnotation', + default: 'Small', + options: [ + { + name: 'small', + }, + { + name: 'large', + }, + ], + }, + }, + { + name: 'intermediate', + optional: true, + typeAnnotation: { + type: 'BooleanTypeAnnotation', + default: false, + }, + }, + ], + }, + }, + }, + }, +}; + +module.exports = SwitchSchema; diff --git a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm index d6270063b..95f21877c 100644 --- a/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm @@ -7,8 +7,9 @@ #import "RCTActivityIndicatorViewComponentView.h" -#import -#import +#import +#import +#import using namespace facebook::react;