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 Jun 11, 2024
1 parent 0d34569 commit a237918
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,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 @@ -375,7 +375,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 @@ -134,6 +134,8 @@ public class ReactSurfaceView(context: Context?, private val surface: ReactSurfa
// This surface view is always on Fabric.
@UIManagerType override fun getUIManagerType(): Int = UIManagerType.FABRIC

override fun getJSModuleName(): String = surface.moduleName

override fun dispatchJSTouchEvent(event: MotionEvent) {
val eventDispatcher = surface.eventDispatcher
if (eventDispatcher != null) {
Expand Down

0 comments on commit a237918

Please sign in to comment.