Skip to content

Commit

Permalink
fix: new arch codegen by unify NativeRNExternalDisplayEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Sep 1, 2024
1 parent 9c9350c commit 88057a7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Context;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.Arguments;

Expand Down Expand Up @@ -37,4 +38,18 @@ public WritableMap getInitialScreens() {

@Override
public void init() {}

// --- Mock methods (from iOS) ---

@Override
public boolean requestScene(ReadableMap options) { return false; }

@Override
public boolean closeScene(String sceneId) { return false; }

@Override
public boolean isMainSceneActive() { return false; }

@Override
public boolean resumeMainScene() { return false; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;

import android.view.Display;
import android.hardware.display.DisplayManager;
Expand Down Expand Up @@ -33,4 +34,18 @@ public Map<String, Object> getConstants() {
map.put("SCREEN_INFO", ExternalDisplayHelper.getScreenInfo(dm.getDisplays()));
return map;
}

// --- Mock methods (from iOS) ---

@Override
public boolean requestScene(ReadableMap options) { return false; }

@Override
public boolean closeScene(String sceneId) { return false; }

@Override
public boolean isMainSceneActive() { return false; }

@Override
public boolean resumeMainScene() { return false; }
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface Spec extends TurboModule {
getInitialScreens: () => {||},
init: () => void,

// Scene API
// Scene API (iOS only)
requestScene: (options: {}) => boolean,
closeScene: (sceneId: string) => boolean,
isMainSceneActive: () => boolean,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-external-display/js/SceneManager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RNExternalDisplayEvent from './NativeRNExternalDisplayEvent.android'
import RNExternalDisplayEvent from './NativeRNExternalDisplayEvent'

const sceneTypes = {
EXTERNAL_DISPLAY: '@RNExternalDisplay_externalDisplay',
Expand Down

0 comments on commit 88057a7

Please sign in to comment.