Skip to content

Commit

Permalink
Add ReactMarkerConstants.CONTENT_APPEARED support on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Mar 22, 2024
1 parent ad9f0b0 commit b3e2a3e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,8 @@ public void run() {

if (mShouldLogContentAppeared) {
mShouldLogContentAppeared = false;

if (mJSModuleName != null) {
ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, mJSModuleName, mRootViewTag);
}
String jsModuleName = getJSModuleName();
ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, jsModuleName, mRootViewTag);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ public DevSupportManager getDevSupportManager() {
public ReactSurface createSurface(
Context context, String moduleName, @Nullable Bundle initialProps) {
ReactSurfaceImpl surface = new ReactSurfaceImpl(context, moduleName, initialProps);
surface.attachView(new ReactSurfaceView(context, surface));
ReactSurfaceView surfaceView = new ReactSurfaceView(context, surface);
surfaceView.setShouldLogContentAppeared(true);
surface.attachView(surfaceView);
surface.attach(this);
return surface;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ public void setIsFabric(boolean isFabric) {
return UIManagerType.FABRIC;
}

@Override
public String getJSModuleName() {
return mSurface.getModuleName();
}

@Override
protected void dispatchJSTouchEvent(MotionEvent event) {
if (mJSTouchDispatcher == null) {
Expand Down

0 comments on commit b3e2a3e

Please sign in to comment.