本文整理汇总了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.
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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());
}
}
示例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);
}
}
示例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();
}
示例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.
}
}