Java 类com.facebook.react.views.text.ReactTextShadowNode 实例源码

项目:RNLearn_Project1    文件:UIManagerModuleTest.java   
@Test
public void testUpdateSimpleHierarchy() {
  UIManagerModule uiManager = getUIManagerModule();

  ViewGroup rootView = createSimpleTextHierarchy(uiManager, "Some text");
  TextView textView = (TextView) rootView.getChildAt(0);

  int rawTextTag = 3;
  uiManager.updateView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, "New text"));

  uiManager.onBatchComplete();
  executePendingFrameCallbacks();

  assertThat(textView.getText().toString()).isEqualTo("New text");
}
项目:RNLearn_Project1    文件:UIManagerModuleTest.java   
@Test
public void testUpdateSimpleHierarchy() {
  UIManagerModule uiManager = getUIManagerModule();

  ViewGroup rootView = createSimpleTextHierarchy(uiManager, "Some text");
  TextView textView = (TextView) rootView.getChildAt(0);

  int rawTextTag = 3;
  uiManager.updateView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, "New text"));

  uiManager.onBatchComplete();
  executePendingFrameCallbacks();

  assertThat(textView.getText().toString()).isEqualTo("New text");
}
项目:ReactNativeSignatureExample    文件:UIManagerModuleTest.java   
@Test
public void testUpdateSimpleHierarchy() {
  UIManagerModule uiManager = getUIManagerModule();

  ViewGroup rootView = createSimpleTextHierarchy(uiManager, "Some text");
  TextView textView = (TextView) rootView.getChildAt(0);

  int rawTextTag = 3;
  uiManager.updateView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, "New text"));

  uiManager.onBatchComplete();
  executePendingChoreographerCallbacks();

  assertThat(textView.getText().toString()).isEqualTo("New text");
}
项目:react-native-ibeacon-android    文件:UIManagerModuleTest.java   
@Test
public void testUpdateSimpleHierarchy() {
  UIManagerModule uiManager = getUIManagerModule();

  ViewGroup rootView = createSimpleTextHierarchy(uiManager, "Some text");
  TextView textView = (TextView) rootView.getChildAt(0);

  int rawTextTag = 3;
  uiManager.updateView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, "New text"));

  uiManager.onBatchComplete();
  executePendingChoreographerCallbacks();

  assertThat(textView.getText().toString()).isEqualTo("New text");
}
项目:react-native-box-loaders    文件:UIManagerModuleTest.java   
@Test
public void testUpdateSimpleHierarchy() {
  UIManagerModule uiManager = getUIManagerModule();

  ViewGroup rootView = createSimpleTextHierarchy(uiManager, "Some text");
  TextView textView = (TextView) rootView.getChildAt(0);

  int rawTextTag = 3;
  uiManager.updateView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, "New text"));

  uiManager.onBatchComplete();
  executePendingChoreographerCallbacks();

  assertThat(textView.getText().toString()).isEqualTo("New text");
}
项目:Ironman    文件:UIManagerModuleTest.java   
@Test
public void testUpdateSimpleHierarchy() {
  UIManagerModule uiManager = getUIManagerModule();

  ViewGroup rootView = createSimpleTextHierarchy(uiManager, "Some text");
  TextView textView = (TextView) rootView.getChildAt(0);

  int rawTextTag = 3;
  uiManager.updateView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, "New text"));

  uiManager.onBatchComplete();
  executePendingChoreographerCallbacks();

  assertThat(textView.getText().toString()).isEqualTo("New text");
}
项目:RNLearn_Project1    文件:UIManagerModuleTest.java   
/**
 * Assuming no other views have been created, the root view will have tag 1, Text tag 2, and
 * RawText tag 3.
 */
private ViewGroup createSimpleTextHierarchy(UIManagerModule uiManager, String text) {
  ReactRootView rootView =
      new ReactRootView(RuntimeEnvironment.application.getApplicationContext());
  int rootTag = uiManager.addMeasuredRootView(rootView);
  int textTag = rootTag + 1;
  int rawTextTag = textTag + 1;

  uiManager.createView(
      textTag,
      ReactTextViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));
  uiManager.createView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, text, "collapsable", false));

  uiManager.manageChildren(
      textTag,
      null,
      null,
      JavaOnlyArray.of(rawTextTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.manageChildren(
      rootTag,
      null,
      null,
      JavaOnlyArray.of(textTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.onBatchComplete();
  executePendingFrameCallbacks();

  return rootView;
}
项目:RNLearn_Project1    文件:UIManagerModuleTest.java   
/**
 * Assuming no other views have been created, the root view will have tag 1, Text tag 2, and
 * RawText tag 3.
 */
private ViewGroup createSimpleTextHierarchy(UIManagerModule uiManager, String text) {
  ReactRootView rootView =
      new ReactRootView(RuntimeEnvironment.application.getApplicationContext());
  int rootTag = uiManager.addMeasuredRootView(rootView);
  int textTag = rootTag + 1;
  int rawTextTag = textTag + 1;

  uiManager.createView(
      textTag,
      ReactTextViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));
  uiManager.createView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, text, "collapsable", false));

  uiManager.manageChildren(
      textTag,
      null,
      null,
      JavaOnlyArray.of(rawTextTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.manageChildren(
      rootTag,
      null,
      null,
      JavaOnlyArray.of(textTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.onBatchComplete();
  executePendingFrameCallbacks();

  return rootView;
}
项目:ReactNativeSignatureExample    文件:UIManagerModuleTest.java   
/**
 * Assuming no other views have been created, the root view will have tag 1, Text tag 2, and
 * RawText tag 3.
 */
private ViewGroup createSimpleTextHierarchy(UIManagerModule uiManager, String text) {
  ReactRootView rootView =
      new ReactRootView(RuntimeEnvironment.application.getApplicationContext());
  int rootTag = uiManager.addMeasuredRootView(rootView);
  int textTag = rootTag + 1;
  int rawTextTag = textTag + 1;

  uiManager.createView(
      textTag,
      ReactTextViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));
  uiManager.createView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, text, "collapsable", false));

  uiManager.manageChildren(
      textTag,
      null,
      null,
      JavaOnlyArray.of(rawTextTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.manageChildren(
      rootTag,
      null,
      null,
      JavaOnlyArray.of(textTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.onBatchComplete();
  executePendingChoreographerCallbacks();

  return rootView;
}
项目:react-native-ibeacon-android    文件:UIManagerModuleTest.java   
/**
 * Assuming no other views have been created, the root view will have tag 1, Text tag 2, and
 * RawText tag 3.
 */
private ViewGroup createSimpleTextHierarchy(UIManagerModule uiManager, String text) {
  ReactRootView rootView =
      new ReactRootView(RuntimeEnvironment.application.getApplicationContext());
  int rootTag = uiManager.addMeasuredRootView(rootView);
  int textTag = rootTag + 1;
  int rawTextTag = textTag + 1;

  uiManager.createView(
      textTag,
      ReactTextViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));
  uiManager.createView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, text, "collapsable", false));

  uiManager.manageChildren(
      textTag,
      null,
      null,
      JavaOnlyArray.of(rawTextTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.manageChildren(
      rootTag,
      null,
      null,
      JavaOnlyArray.of(textTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.onBatchComplete();
  executePendingChoreographerCallbacks();

  return rootView;
}
项目:react-native-box-loaders    文件:UIManagerModuleTest.java   
/**
 * Assuming no other views have been created, the root view will have tag 1, Text tag 2, and
 * RawText tag 3.
 */
private ViewGroup createSimpleTextHierarchy(UIManagerModule uiManager, String text) {
  ReactRootView rootView =
      new ReactRootView(RuntimeEnvironment.application.getApplicationContext());
  int rootTag = uiManager.addMeasuredRootView(rootView);
  int textTag = rootTag + 1;
  int rawTextTag = textTag + 1;

  uiManager.createView(
      textTag,
      ReactTextViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));
  uiManager.createView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, text, "collapsable", false));

  uiManager.manageChildren(
      textTag,
      null,
      null,
      JavaOnlyArray.of(rawTextTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.manageChildren(
      rootTag,
      null,
      null,
      JavaOnlyArray.of(textTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.onBatchComplete();
  executePendingChoreographerCallbacks();

  return rootView;
}
项目:Ironman    文件:UIManagerModuleTest.java   
/**
 * Assuming no other views have been created, the root view will have tag 1, Text tag 2, and
 * RawText tag 3.
 */
private ViewGroup createSimpleTextHierarchy(UIManagerModule uiManager, String text) {
  ReactRootView rootView =
      new ReactRootView(RuntimeEnvironment.application.getApplicationContext());
  int rootTag = uiManager.addMeasuredRootView(rootView);
  int textTag = rootTag + 1;
  int rawTextTag = textTag + 1;

  uiManager.createView(
      textTag,
      ReactTextViewManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of("collapsable", false));
  uiManager.createView(
      rawTextTag,
      ReactRawTextManager.REACT_CLASS,
      rootTag,
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, text, "collapsable", false));

  uiManager.manageChildren(
      textTag,
      null,
      null,
      JavaOnlyArray.of(rawTextTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.manageChildren(
      rootTag,
      null,
      null,
      JavaOnlyArray.of(textTag),
      JavaOnlyArray.of(0),
      null);

  uiManager.onBatchComplete();
  executePendingChoreographerCallbacks();

  return rootView;
}