當前位置: 首頁>>代碼示例>>Java>>正文


Java RCTEventEmitter.receiveEvent方法代碼示例

本文整理匯總了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);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:25,代碼來源:ImageLoadEvent.java

示例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)));
    }
  };
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:15,代碼來源:NativeAnimatedNodeTraversalTest.java

示例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);
        }
    }
}
 
開發者ID:DylanVann,項目名稱:react-native-fast-image,代碼行數:16,代碼來源:FastImageViewManager.java

示例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);
}
 
開發者ID:ManrajGrover,項目名稱:react-native-box-loaders,代碼行數:15,代碼來源:OnLayoutEvent.java

示例5: dispatch

import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
  rctEventEmitter.receiveEvent(getViewTag(), getEventName(), serializeEventData());
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:5,代碼來源:ReactSliderEvent.java

示例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);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:7,代碼來源:TopMessageEvent.java

示例7: dispatch

import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
  rctEventEmitter.receiveEvent(getViewTag(), getEventName(), Arguments.createMap());
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:5,代碼來源:DrawerClosedEvent.java

示例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);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:5,代碼來源:RefreshEvent.java

示例11: dispatch

import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
  rctEventEmitter.receiveEvent(getViewTag(), getEventName(), null);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:5,代碼來源:RequestCloseEvent.java

示例12: dispatch

import com.facebook.react.uimanager.events.RCTEventEmitter; //導入方法依賴的package包/類
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
  rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mEventData);
}
 
開發者ID:john1jan,項目名稱:ReactNativeSignatureExample,代碼行數:5,代碼來源:TopLoadingFinishEvent.java


注:本文中的com.facebook.react.uimanager.events.RCTEventEmitter.receiveEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。