当前位置: 首页>>代码示例>>Java>>正文


Java Systrace.startAsyncFlow方法代码示例

本文整理汇总了Java中com.facebook.systrace.Systrace.startAsyncFlow方法的典型用法代码示例。如果您正苦于以下问题:Java Systrace.startAsyncFlow方法的具体用法?Java Systrace.startAsyncFlow怎么用?Java Systrace.startAsyncFlow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.systrace.Systrace的用法示例。


在下文中一共展示了Systrace.startAsyncFlow方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispatchEvent

import com.facebook.systrace.Systrace; //导入方法依赖的package包/类
/**
 * Sends the given Event to JS, coalescing eligible events if JS is backed up.
 */
public void dispatchEvent(Event event) {
  Assertions.assertCondition(event.isInitialized(), "Dispatched event hasn't been initialized");

  for (EventDispatcherListener listener : mListeners) {
    listener.onEventDispatch(event);
  }

  synchronized (mEventsStagingLock) {
    mEventStaging.add(event);
    Systrace.startAsyncFlow(
        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
        event.getEventName(),
        event.getUniqueID());
  }
  if (mRCTEventEmitter != null) {
    // If the host activity is paused, the frame callback may not be currently
    // posted. Ensure that it is so that this event gets delivered promptly.
    mCurrentFrameCallback.maybePostFromNonUI();
  } else {
    // No JS application has started yet, or resumed. This can happen when a ReactRootView is
    // added to view hierarchy, but ReactContext creation has not completed yet. In this case, any
    // touch event dispatch will hit this codepath, and we simply queue them so that they
    // are dispatched once ReactContext creation completes and JS app is running.
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:29,代码来源:EventDispatcher.java

示例2: doFrame

import com.facebook.systrace.Systrace; //导入方法依赖的package包/类
@Override
public void doFrame(long frameTimeNanos) {
  UiThreadUtil.assertOnUiThread();

  if (mShouldStop) {
    mIsPosted = false;
  } else {
    post();
  }

  Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ScheduleDispatchFrameCallback");
  try {
    moveStagedEventsToDispatchQueue();

    if (mEventsToDispatchSize > 0 && !mHasDispatchScheduled) {
      mHasDispatchScheduled = true;
      Systrace.startAsyncFlow(
          Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
          "ScheduleDispatchFrameCallback",
          mHasDispatchScheduledCount);
      mReactContext.runOnJSQueueThread(mDispatchEventsRunnable);
    }
  } finally {
    Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:27,代码来源:EventDispatcher.java

示例3: UpdateLayoutOperation

import com.facebook.systrace.Systrace; //导入方法依赖的package包/类
public UpdateLayoutOperation(
    int parentTag,
    int tag,
    int x,
    int y,
    int width,
    int height) {
  super(tag);
  mParentTag = parentTag;
  mX = x;
  mY = y;
  mWidth = width;
  mHeight = height;
  Systrace.startAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, "updateLayout", mTag);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:16,代码来源:UIViewOperationQueue.java

示例4: CreateViewOperation

import com.facebook.systrace.Systrace; //导入方法依赖的package包/类
public CreateViewOperation(
    ThemedReactContext themedContext,
    int tag,
    String className,
    @Nullable ReactStylesDiffMap initialProps) {
  super(tag);
  mThemedContext = themedContext;
  mClassName = className;
  mInitialProps = initialProps;
  Systrace.startAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, "createView", mTag);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:12,代码来源:UIViewOperationQueue.java

示例5: dispatchEvent

import com.facebook.systrace.Systrace; //导入方法依赖的package包/类
/**
 * Sends the given Event to JS, coalescing eligible events if JS is backed up.
 */
public void dispatchEvent(Event event) {
  Assertions.assertCondition(event.isInitialized(), "Dispatched event hasn't been initialized");
  synchronized (mEventsStagingLock) {
    mEventStaging.add(event);
    Systrace.startAsyncFlow(
        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
        event.getEventName(),
        event.getUniqueID());
  }
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:14,代码来源:EventDispatcher.java

示例6: doFrame

import com.facebook.systrace.Systrace; //导入方法依赖的package包/类
@Override
public void doFrame(long frameTimeNanos) {
  UiThreadUtil.assertOnUiThread();

  if (mShouldStop) {
    return;
  }

  Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ScheduleDispatchFrameCallback");
  try {
    moveStagedEventsToDispatchQueue();

    if (!mHasDispatchScheduled) {
      mHasDispatchScheduled = true;
      Systrace.startAsyncFlow(
          Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
          "ScheduleDispatchFrameCallback",
          mHasDispatchScheduledCount);
      mReactContext.runOnJSQueueThread(mDispatchEventsRunnable);
    }

    ReactChoreographer.getInstance()
        .postFrameCallback(ReactChoreographer.CallbackType.TIMERS_EVENTS, this);
  } finally {
    Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
  }
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:28,代码来源:EventDispatcher.java

示例7: dispatchEvent

import com.facebook.systrace.Systrace; //导入方法依赖的package包/类
/**
 * Sends the given Event to JS, coalescing eligible events if JS is backed up.
 */
public void dispatchEvent(Event event) {
  Assertions.assertCondition(event.isInitialized(), "Dispatched event hasn't been initialized");
  synchronized (mEventsStagingLock) {
    mEventStaging.add(event);
    Systrace.startAsyncFlow(
        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
        event.getEventName(),
        event.getUniqueID());
  }
  // If the host activity is paused, the frame callback may not be currently
  // posted. Ensure that it is so that this event gets delivered promptly.
  mCurrentFrameCallback.maybePostFromNonUI();
}
 
开发者ID:ManrajGrover,项目名称:react-native-box-loaders,代码行数:17,代码来源:EventDispatcher.java

示例8: dispatchEvent

import com.facebook.systrace.Systrace; //导入方法依赖的package包/类
/**
 * Sends the given Event to JS, coalescing eligible events if JS is backed up.
 */
public void dispatchEvent(Event event) {
  Assertions.assertCondition(event.isInitialized(), "Dispatched event hasn't been initialized");

  boolean eventHandled = false;
  for (EventDispatcherListener listener : mListeners) {
    if (listener.onEventDispatch(event)) {
      eventHandled = true;
    }
  }

  // If the event was handled by one of the event listener don't send it to JS.
  if (eventHandled) {
    return;
  }

  synchronized (mEventsStagingLock) {
    mEventStaging.add(event);
    Systrace.startAsyncFlow(
        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
        event.getEventName(),
        event.getUniqueID());
  }
  if (mRCTEventEmitter != null) {
    // If the host activity is paused, the frame callback may not be currently
    // posted. Ensure that it is so that this event gets delivered promptly.
    mCurrentFrameCallback.maybePostFromNonUI();
  } else {
    // No JS application has started yet, or resumed. This can happen when a ReactRootView is
    // added to view hierarchy, but ReactContext creation has not completed yet. In this case, any
    // touch event dispatch will hit this codepath, and we simply queue them so that they
    // are dispatched once ReactContext creation completes and JS app is running.
  }
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:37,代码来源:EventDispatcher.java


注:本文中的com.facebook.systrace.Systrace.startAsyncFlow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。