-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
315f635
commit 3ebf766
Showing
14 changed files
with
161 additions
and
10 deletions.
There are no files selected for viewing
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
3 changes: 2 additions & 1 deletion
3
Apps/BRNPlayground/android/gradle/wrapper/gradle-wrapper.properties
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
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
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
38 changes: 38 additions & 0 deletions
38
...react-native-iosandroid/android/src/fabric/java/com/babylonreactnative/BabylonModule.java
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,38 @@ | ||
package com.babylonreactnative; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.facebook.react.bridge.Promise; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.module.annotations.ReactModule; | ||
|
||
@ReactModule(name = BabylonModule.NAME) | ||
public final class BabylonModule extends NativeBabylonModuleSpec { | ||
static final String NAME = "EngineViewNativeComponent"; | ||
|
||
BabylonModule(ReactApplicationContext reactContext) { | ||
super(reactContext); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return BabylonModule.NAME; | ||
} | ||
|
||
@Override | ||
public void initialize(Promise promise) { | ||
// this.getReactApplicationContext().runOnJSQueueThread(() -> { | ||
// BabylonNativeInterop.initialize(this.getReactApplicationContext()); | ||
// promise.resolve(null); | ||
// }); | ||
} | ||
|
||
@Override | ||
public void resetView(Promise promise) { | ||
// this.getReactApplicationContext().runOnUiQueueThread(() -> { | ||
// BabylonNativeInterop.resetView(); | ||
// promise.resolve(null); | ||
// }); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...t-native-iosandroid/android/src/fabric/java/com/babylonreactnative/EngineViewManager.java
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,68 @@ | ||
package com.babylonreactnative; | ||
|
||
import android.view.View; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.module.annotations.ReactModule; | ||
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; | ||
|
||
@ReactModule(name = EngineViewManager.NAME) | ||
public final class EngineViewManager extends SimpleViewManager<EngineView> implements EngineViewNativeComponentManagerInterface<EngineView> { | ||
private final ViewManagerDelegate<EngineView> mDelegate; | ||
|
||
static final String NAME = "EngineViewNativeComponent"; | ||
@NonNull | ||
@Override | ||
public String getName() { | ||
return EngineViewManager.NAME; | ||
} | ||
|
||
public EngineViewManager() { | ||
mDelegate = new EngineViewNativeComponentManagerDelegate<>(this); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
protected ViewManagerDelegate<EngineView> getDelegate() { | ||
return mDelegate; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
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); | ||
} | ||
|
||
@Override | ||
public void setAntiAliasing(EngineView view, int value) { | ||
view.setAntiAliasing(value); | ||
} | ||
|
||
@Override | ||
public void setAndroidView(EngineView view, @Nullable String value) { | ||
view.setAndroidView(value); | ||
} | ||
|
||
@Override | ||
public void takeSnapshot(EngineView view) { | ||
view.takeSnapshot(); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
.../react-native-iosandroid/android/src/main/java/com/babylonreactnative/BabylonPackage.java
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
File renamed without changes.
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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import EngineView from './spec/EngineViewNativeComponent' | ||
import EngineView, {NativeProps} from './spec/EngineViewNativeComponent' | ||
|
||
export { EngineView as NativeEngineView }; | ||
export type { NativeProps as NativeEngineViewProps }; |
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
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