Skip to content

Commit

Permalink
fix: change the name back to EngineView
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Nov 21, 2024
1 parent e93f7b8 commit 7ead561
Show file tree
Hide file tree
Showing 9 changed files with 10,308 additions and 3,605 deletions.
1,423 changes: 418 additions & 1,005 deletions Apps/BRNPlayground/ios/Podfile.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ dependencies {
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../../react-native/spec")
libraryName = "BabylonModuleSpec"
libraryName = "BabylonReactNative"
codegenJavaPackageName = "com.babylonreactnative"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@
import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewManagerDelegate;
import com.facebook.react.viewmanagers.EngineViewNativeComponentManagerDelegate;
import com.facebook.react.viewmanagers.EngineViewNativeComponentManagerInterface;
import com.facebook.react.viewmanagers.EngineViewManagerDelegate;
import com.facebook.react.viewmanagers.EngineViewManagerInterface;

@ReactModule(name = EngineViewManager.NAME)
public final class EngineViewManager extends SimpleViewManager<EngineView> implements EngineViewNativeComponentManagerInterface<EngineView> {
public final class EngineViewManager extends SimpleViewManager<EngineView> implements EngineViewManagerInterface<EngineView> {
private final ViewManagerDelegate<EngineView> mDelegate;

static final String NAME = "EngineViewNativeComponent";
static final String NAME = "EngineView";

@NonNull
@Override
public String getName() {
return EngineViewManager.NAME;
}

public EngineViewManager() {
mDelegate = new EngineViewNativeComponentManagerDelegate<>(this);
mDelegate = new EngineViewManagerDelegate<>(this);
}

@Nullable
Expand All @@ -37,12 +38,6 @@ protected EngineView createViewInstance(@NonNull ThemedReactContext reactContext
return new EngineView(reactContext);
}

@Override
public void onDropViewInstance(@NonNull EngineView view) {
super.onDropViewInstance(view);
// TODO: Native view specific cleanup
}

@Override
public void setIsTransparent(EngineView view, boolean value) {
view.setIsTransparent(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public final class EngineViewManager extends SimpleViewManager<EngineView> {
@NonNull
@Override
public String getName() {
return "EngineViewNativeComponent";
return "EngineView";
}

@ReactProp(name = "isTransparent")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#import <React/RCTInvalidating.h>

#ifdef RCT_NEW_ARCH_ENABLED
#import <BabylonModuleSpec/BabylonModuleSpec.h>
#import <BabylonReactNative/BabylonReactNative.h>
#endif

#import <Foundation/Foundation.h>
Expand Down Expand Up @@ -35,6 +35,7 @@ @implementation BabylonModule
});
}


RCT_EXPORT_METHOD(resetView:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
dispatch_async(dispatch_get_main_queue(), ^{
[BabylonNativeInterop resetView];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include <UIKit/UIKit.h>
#include "react/renderer/componentregistry/ComponentDescriptorProvider.h"

#import <react/renderer/components/BabylonModuleSpec/ComponentDescriptors.h>
#import <react/renderer/components/BabylonModuleSpec/EventEmitters.h>
#import <react/renderer/components/BabylonModuleSpec/Props.h>
#import <react/renderer/components/BabylonModuleSpec/RCTComponentViewHelpers.h>
#import <react/renderer/components/BabylonReactNative/ComponentDescriptors.h>
#import <react/renderer/components/BabylonReactNative/EventEmitters.h>
#import <react/renderer/components/BabylonReactNative/Props.h>
#import <react/renderer/components/BabylonReactNative/RCTComponentViewHelpers.h>

#import "RCTFabricComponentsPlugins.h"

Expand All @@ -17,20 +17,20 @@

using namespace facebook::react;

@interface BabylonEngineViewComponentView () <RCTEngineViewNativeComponentViewProtocol>
@interface BabylonEngineViewComponentView () <RCTEngineViewViewProtocol>
@end

@implementation BabylonEngineViewComponentView {
EngineView* _engineView;
}

+ (ComponentDescriptorProvider)componentDescriptorProvider {
return concreteComponentDescriptorProvider<EngineViewNativeComponentComponentDescriptor>();
return concreteComponentDescriptorProvider<EngineViewComponentDescriptor>();
}

- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
static const auto defaultProps = std::make_shared<const EngineViewNativeComponentProps>();
static const auto defaultProps = std::make_shared<const EngineViewProps>();
_props = defaultProps;
_engineView = [[EngineView alloc] init];
_engineView.translatesAutoresizingMaskIntoConstraints = false;
Expand All @@ -48,8 +48,8 @@ - (instancetype)initWithFrame:(CGRect)frame {

- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
{
const auto &oldViewProps = *std::static_pointer_cast<EngineViewNativeComponentProps const>(_props);
const auto &newViewProps = *std::static_pointer_cast<EngineViewNativeComponentProps const>(props);
const auto &oldViewProps = *std::static_pointer_cast<EngineViewProps const>(_props);
const auto &newViewProps = *std::static_pointer_cast<EngineViewProps const>(props);

if (oldViewProps.isTransparent != newViewProps.isTransparent) {
[_engineView setIsTransparentFlag:[NSNumber numberWithBool:newViewProps.isTransparent]];
Expand All @@ -74,7 +74,7 @@ - (void)takeSnapshot {

@end

Class<RCTComponentViewProtocol> EngineViewNativeComponentCls(void) {
Class<RCTComponentViewProtocol> EngineViewCls(void) {
return BabylonEngineViewComponentView.class;
}

Expand Down
Loading

0 comments on commit 7ead561

Please sign in to comment.