com.facebook.react.uimanager.UIViewOperationQueue Java Examples

The following examples show how to use com.facebook.react.uimanager.UIViewOperationQueue. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RNCustomKeyboardKitModule.java    From react-native-custom-keyboard-kit with MIT License 6 votes vote down vote up
private ReactEditText getEditById(int id) {
  // UIViewOperationQueue uii = this.getReactApplicationContext().getNativeModule(UIManagerModule.class).getUIImplementation().getUIViewOperationQueue();
  // return (ReactEditText) uii.getNativeViewHierarchyManager().resolveView(id);

  UIViewOperationQueue uii = null;
  ReactEditText edit = null;

  while (edit == null) {
    uii = this.getReactApplicationContext().getNativeModule(UIManagerModule.class).getUIImplementation().getUIViewOperationQueue();

    try {
      edit = (ReactEditText) uii.getNativeViewHierarchyManager().resolveView(id);
    } catch (IllegalViewOperationException e) {

    }
  }

  return edit;
}
 
Example #2
Source File: ReactTextInputShadowNode.java    From react-native-GPay with MIT License 6 votes vote down vote up
@Override
public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
  super.onCollectExtraUpdates(uiViewOperationQueue);

  if (mMostRecentEventCount != UNSET) {
    ReactTextUpdate reactTextUpdate =
        new ReactTextUpdate(
            spannedFromShadowNode(this, getText()),
            mMostRecentEventCount,
            mContainsImages,
            getPadding(Spacing.LEFT),
            getPadding(Spacing.TOP),
            getPadding(Spacing.RIGHT),
            getPadding(Spacing.BOTTOM),
            mTextAlign,
            mTextBreakStrategy);
    uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);
  }
}
 
Example #3
Source File: ReactTextShadowNode.java    From react-native-GPay with MIT License 6 votes vote down vote up
@Override
public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
  super.onCollectExtraUpdates(uiViewOperationQueue);

  if (mPreparedSpannableText != null) {
    ReactTextUpdate reactTextUpdate =
      new ReactTextUpdate(
        mPreparedSpannableText,
        UNSET,
        mContainsImages,
        getPadding(Spacing.START),
        getPadding(Spacing.TOP),
        getPadding(Spacing.END),
        getPadding(Spacing.BOTTOM),
        getTextAlign(),
        mTextBreakStrategy
      );
    uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), reactTextUpdate);
  }
}
 
Example #4
Source File: FabricUIManager.java    From react-native-GPay with MIT License 6 votes vote down vote up
public FabricUIManager(
    ReactApplicationContext reactContext,
    ViewManagerRegistry viewManagerRegistry,
    JavaScriptContextHolder jsContext,
    EventDispatcher eventDispatcher) {
  DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext);
  mReactApplicationContext = reactContext;
  mViewManagerRegistry = viewManagerRegistry;
  mNativeViewHierarchyManager = new NativeViewHierarchyManager(viewManagerRegistry);
  mUIViewOperationQueue =
      new UIViewOperationQueue(
          reactContext, mNativeViewHierarchyManager, 0);
  mFabricReconciler = new FabricReconciler(mUIViewOperationQueue);
  mFabricEventEmitter =
    new FabricEventEmitter(mReactApplicationContext, this);
  mEventDispatcher = eventDispatcher;
  mJSContext = jsContext;
}
 
Example #5
Source File: RNShadowTextGradient.java    From react-native-text-gradient with MIT License 6 votes vote down vote up
@Override
public boolean dispatchUpdates(
  float absoluteX,
  float absoluteY,
  UIViewOperationQueue uiViewOperationQueue,
  NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer
) {
  boolean layoutHasChanged = super.dispatchUpdates(
    absoluteX,
    absoluteY,
    uiViewOperationQueue,
    nativeViewHierarchyOptimizer
  );

  if (layoutHasChanged) {
    markUpdated();
  }

  return layoutHasChanged;
}
 
Example #6
Source File: SizeReportingShadowNode.java    From react-native-amap with MIT License 5 votes vote down vote up
@Override
public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
  super.onCollectExtraUpdates(uiViewOperationQueue);

  Map<String, Float> data = new HashMap<>();
  data.put("width", getLayoutWidth());
  data.put("height", getLayoutHeight());

  uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), data);
}
 
Example #7
Source File: ARTSurfaceViewShadowNode.java    From art with MIT License 4 votes vote down vote up
@Override
public void onCollectExtraUpdates(UIViewOperationQueue uiUpdater) {
  super.onCollectExtraUpdates(uiUpdater);
  drawOutput(false);
  uiUpdater.enqueueUpdateExtraData(getReactTag(), this);
}
 
Example #8
Source File: ARTSurfaceViewShadowNode.java    From react-native-GPay with MIT License 4 votes vote down vote up
@Override
public void onCollectExtraUpdates(UIViewOperationQueue uiUpdater) {
  super.onCollectExtraUpdates(uiUpdater);
  drawOutput();
  uiUpdater.enqueueUpdateExtraData(getReactTag(), this);
}
 
Example #9
Source File: FabricReconciler.java    From react-native-GPay with MIT License 4 votes vote down vote up
public FabricReconciler(UIViewOperationQueue uiViewOperationQueue) {
  this.uiViewOperationQueue = uiViewOperationQueue;
}
 
Example #10
Source File: TweetShadowNode.java    From react-native-twitterkit with MIT License 4 votes vote down vote up
@Override
public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
  super.onCollectExtraUpdates(uiViewOperationQueue);

  uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), getReactTag());
}