mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
fix content appeared logging
Reviewed By: AaaChiuuu Differential Revision: D5630723 fbshipit-source-id: 3791537afdb7ca4992c2562577466c2ef5baafce
This commit is contained in:
parent
e16dd51a0e
commit
091878a61a
@ -81,7 +81,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
|
||||
private @Nullable ReactRootViewEventListener mRootViewEventListener;
|
||||
private int mRootViewTag = ReactRootViewTagGenerator.getNextRootViewTag();
|
||||
private boolean mIsAttachedToInstance;
|
||||
private boolean mContentAppeared;
|
||||
private boolean mShouldLogContentAppeared;
|
||||
private final JSTouchDispatcher mJSTouchDispatcher = new JSTouchDispatcher(this);
|
||||
|
||||
public ReactRootView(Context context) {
|
||||
@ -195,20 +195,15 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
|
||||
public void onViewAdded(View child) {
|
||||
super.onViewAdded(child);
|
||||
|
||||
if (!mContentAppeared) {
|
||||
mContentAppeared = true;
|
||||
ReactMarker.logMarker(
|
||||
ReactMarkerConstants.CONTENT_APPEARED, getJSModuleName(), getRootViewTag());
|
||||
if (mShouldLogContentAppeared) {
|
||||
mShouldLogContentAppeared = false;
|
||||
|
||||
if (mJSModuleName != null) {
|
||||
ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, mJSModuleName, mRootViewTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllViewsInLayout() {
|
||||
super.removeAllViewsInLayout();
|
||||
|
||||
mContentAppeared = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@see #startReactApplication(ReactInstanceManager, String, android.os.Bundle)}
|
||||
*/
|
||||
@ -240,6 +235,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
|
||||
mReactInstanceManager = reactInstanceManager;
|
||||
mJSModuleName = moduleName;
|
||||
mAppProperties = initialProperties;
|
||||
mShouldLogContentAppeared = true;
|
||||
|
||||
if (!mReactInstanceManager.hasStartedCreatingInitialContext()) {
|
||||
mReactInstanceManager.createReactContextInBackground();
|
||||
@ -263,6 +259,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout implements RootView
|
||||
mIsAttachedToInstance = false;
|
||||
mRootViewTag = ReactRootViewTagGenerator.getNextRootViewTag();
|
||||
}
|
||||
mShouldLogContentAppeared = true;
|
||||
}
|
||||
|
||||
public void onAttachedToReactInstance() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user