本文整理匯總了Java中com.facebook.react.uimanager.events.RCTEventEmitter.receiveEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java RCTEventEmitter.receiveEvent方法的具體用法?Java RCTEventEmitter.receiveEvent怎麽用?Java RCTEventEmitter.receiveEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.react.uimanager.events.RCTEventEmitter
的用法示例。
在下文中一共展示了RCTEventEmitter.receiveEvent方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
WritableMap eventData = null;
if (mImageUri != null || mEventType == ON_LOAD) {
eventData = Arguments.createMap();
if (mImageUri != null) {
eventData.putString("uri", mImageUri);
}
if (mEventType == ON_LOAD) {
WritableMap source = Arguments.createMap();
source.putDouble("width", mWidth);
source.putDouble("height", mHeight);
if (mImageUri != null) {
source.putString("url", mImageUri);
}
eventData.putMap("source", source);
}
}
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), eventData);
}
示例2: createScrollEvent
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
private Event createScrollEvent(final int tag, final double value) {
return new Event(tag) {
@Override
public String getEventName() {
return "topScroll";
}
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(tag, "topScroll", JavaOnlyMap.of(
"contentOffset", JavaOnlyMap.of("y", value)));
}
};
}
示例3: onProgress
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void onProgress(String key, long bytesRead, long expectedLength) {
List<ImageViewWithUrl> viewsForKey = VIEWS_FOR_URLS.get(key);
if (viewsForKey != null) {
for (ImageViewWithUrl view: viewsForKey) {
WritableMap event = new WritableNativeMap();
event.putInt("loaded", (int) bytesRead);
event.putInt("total", (int) expectedLength);
ThemedReactContext context = (ThemedReactContext) view.getContext();
RCTEventEmitter eventEmitter = context.getJSModule(RCTEventEmitter.class);
int viewId = view.getId();
eventEmitter.receiveEvent(viewId, REACT_ON_PROGRESS_EVENT, event);
}
}
}
示例4: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
WritableMap layout = Arguments.createMap();
layout.putDouble("x", PixelUtil.toDIPFromPixel(mX));
layout.putDouble("y", PixelUtil.toDIPFromPixel(mY));
layout.putDouble("width", PixelUtil.toDIPFromPixel(mWidth));
layout.putDouble("height", PixelUtil.toDIPFromPixel(mHeight));
WritableMap event = Arguments.createMap();
event.putMap("layout", layout);
event.putInt("target", getViewTag());
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), event);
}
示例5: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());
}
示例6: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
WritableMap data = Arguments.createMap();
data.putString("data", mData);
rctEventEmitter.receiveEvent(getViewTag(), EVENT_NAME, data);
}
示例7: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), Arguments.createMap());
}
示例8: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());
}
開發者ID:React-Native-Library,項目名稱:react-native-pull-up-down-refresh,代碼行數:5,代碼來源:WindowVisibilityChangeEvent.java
示例9: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch (RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());
}
開發者ID:KingBarbarian,項目名稱:react-native-android-new-crosswalk,代碼行數:5,代碼來源:NavigationStateChangeEvent.java
示例10: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null);
}
示例11: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null);
}
示例12: dispatch
import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mEventData);
}