Permalink
Browse files

fix content appeared logging

Reviewed By: AaaChiuuu

Differential Revision: D5630723

fbshipit-source-id: 3791537afdb7ca4992c2562577466c2ef5baafce
  • Loading branch information...
bnham authored and facebook-github-bot committed Aug 15, 2017
1 parent e16dd51 commit 091878a61ab124b1838492257e1d328516acd8a1
Showing with 9 additions and 12 deletions.
  1. +9 −12 ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java
@@ -81,7 +81,7 @@
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,18 +195,13 @@ protected void onDetachedFromWindow() {
public void onViewAdded(View child) {
super.onViewAdded(child);
if (!mContentAppeared) {
mContentAppeared = true;
ReactMarker.logMarker(
ReactMarkerConstants.CONTENT_APPEARED, getJSModuleName(), getRootViewTag());
}
}
@Override
public void removeAllViewsInLayout() {
super.removeAllViewsInLayout();
if (mShouldLogContentAppeared) {
mShouldLogContentAppeared = false;
mContentAppeared = false;
if (mJSModuleName != null) {
ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, mJSModuleName, mRootViewTag);
}
}
}
/**
@@ -240,6 +235,7 @@ public void startReactApplication(
mReactInstanceManager = reactInstanceManager;
mJSModuleName = moduleName;
mAppProperties = initialProperties;
mShouldLogContentAppeared = true;
if (!mReactInstanceManager.hasStartedCreatingInitialContext()) {
mReactInstanceManager.createReactContextInBackground();
@@ -263,6 +259,7 @@ public void unmountReactApplication() {
mIsAttachedToInstance = false;
mRootViewTag = ReactRootViewTagGenerator.getNextRootViewTag();
}
mShouldLogContentAppeared = true;
}
public void onAttachedToReactInstance() {

0 comments on commit 091878a

Please sign in to comment.