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

项目:RNLearn_Project1    文件:ReactTextInputPropertyTest.java   
@Test
public void testPlaceholderTextColor() {
  ReactEditText view = mManager.createViewInstance(mThemedContext);

  final ColorStateList defaultPlaceholderColorStateList =
      DefaultStyleValuesUtil.getDefaultTextColorHint(
          view.getContext());

  ColorStateList colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", Color.RED));
  colors = view.getHintTextColors();
  assertThat(colors.getDefaultColor()).isEqualTo(Color.RED);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);
}
项目:RNLearn_Project1    文件:ReactTextInputPropertyTest.java   
@Test
public void testPlaceholderTextColor() {
  ReactEditText view = mManager.createViewInstance(mThemedContext);

  final ColorStateList defaultPlaceholderColorStateList =
      DefaultStyleValuesUtil.getDefaultTextColorHint(
          view.getContext());

  ColorStateList colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", Color.RED));
  colors = view.getHintTextColors();
  assertThat(colors.getDefaultColor()).isEqualTo(Color.RED);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);
}
项目:ReactNativeSignatureExample    文件:ReactTextInputPropertyTest.java   
@Test
public void testPlaceholderTextColor() {
  ReactEditText view = mManager.createViewInstance(mThemedContext);

  final ColorStateList defaultPlaceholderColorStateList =
      DefaultStyleValuesUtil.getDefaultTextColorHint(
          view.getContext());

  ColorStateList colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", Color.RED));
  colors = view.getHintTextColors();
  assertThat(colors.getDefaultColor()).isEqualTo(Color.RED);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);
}
项目:react-native-ibeacon-android    文件:ReactTextInputPropertyTest.java   
@Test
public void testPlaceholderTextColor() {
  ReactEditText view = mManager.createViewInstance(mThemedContext);

  final ColorStateList defaultPlaceholderColorStateList =
      DefaultStyleValuesUtil.getDefaultTextColorHint(
          view.getContext());

  ColorStateList colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", Color.RED));
  colors = view.getHintTextColors();
  assertThat(colors.getDefaultColor()).isEqualTo(Color.RED);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);
}
项目:react-native-box-loaders    文件:ReactTextInputPropertyTest.java   
@Test
public void testPlaceholderTextColor() {
  ReactEditText view = mManager.createViewInstance(mThemedContext);

  final ColorStateList defaultPlaceholderColorStateList =
      DefaultStyleValuesUtil.getDefaultTextColorHint(
          view.getContext());

  ColorStateList colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", Color.RED));
  colors = view.getHintTextColors();
  assertThat(colors.getDefaultColor()).isEqualTo(Color.RED);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);
}
项目:Ironman    文件:ReactTextInputPropertyTest.java   
@Test
public void testPlaceholderTextColor() {
  ReactEditText view = mManager.createViewInstance(mThemedContext);

  final ColorStateList defaultPlaceholderColorStateList =
      DefaultStyleValuesUtil.getDefaultTextColorHint(
          view.getContext());

  ColorStateList colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", Color.RED));
  colors = view.getHintTextColors();
  assertThat(colors.getDefaultColor()).isEqualTo(Color.RED);

  mManager.updateProperties(view, buildStyles("placeholderTextColor", null));
  colors = view.getHintTextColors();
  assertThat(colors).isEqualTo(defaultPlaceholderColorStateList);
}
项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@ReactProp(name = "placeholderTextColor", customType = "Color")
public void setPlaceholderTextColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHintTextColor(DefaultStyleValuesUtil.getDefaultTextColorHint(view.getContext()));
  } else {
    view.setHintTextColor(color);
  }
}
项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@ReactProp(name = "selectionColor", customType = "Color")
public void setSelectionColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHighlightColor(DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));
  } else {
    view.setHighlightColor(color);
  }

  setCursorColor(view, color);
}
项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@ReactProp(name = ViewProps.COLOR, customType = "Color")
public void setColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setTextColor(DefaultStyleValuesUtil.getDefaultTextColor(view.getContext()));
  } else {
    view.setTextColor(color);
  }
}
项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@ReactProp(name = "placeholderTextColor", customType = "Color")
public void setPlaceholderTextColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHintTextColor(DefaultStyleValuesUtil.getDefaultTextColorHint(view.getContext()));
  } else {
    view.setHintTextColor(color);
  }
}
项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@ReactProp(name = "selectionColor", customType = "Color")
public void setSelectionColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHighlightColor(DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));
  } else {
    view.setHighlightColor(color);
  }

  setCursorColor(view, color);
}
项目:RNLearn_Project1    文件:ReactTextInputManager.java   
@ReactProp(name = ViewProps.COLOR, customType = "Color")
public void setColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setTextColor(DefaultStyleValuesUtil.getDefaultTextColor(view.getContext()));
  } else {
    view.setTextColor(color);
  }
}
项目:ReactNativeSignatureExample    文件:ReactTextInputManager.java   
@ReactProp(name = "placeholderTextColor", customType = "Color")
public void setPlaceholderTextColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHintTextColor(DefaultStyleValuesUtil.getDefaultTextColorHint(view.getContext()));
  } else {
    view.setHintTextColor(color);
  }
}
项目:ReactNativeSignatureExample    文件:ReactTextInputManager.java   
@ReactProp(name = "selectionColor", customType = "Color")
public void setSelectionColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHighlightColor(DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));
  } else {
    view.setHighlightColor(color);
  }
}
项目:react-native-ibeacon-android    文件:ReactTextInputManager.java   
@ReactProp(name = "placeholderTextColor", customType = "Color")
public void setPlaceholderTextColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHintTextColor(DefaultStyleValuesUtil.getDefaultTextColorHint(view.getContext()));
  } else {
    view.setHintTextColor(color);
  }
}
项目:react-native-ibeacon-android    文件:ReactTextInputManager.java   
@ReactProp(name = "selectionColor", customType = "Color")
public void setSelectionColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHighlightColor(DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));
  } else {
    view.setHighlightColor(color);
  }
}
项目:react-native-text-input    文件:ReactTextInputManager.java   
@ReactProp(name = "placeholderTextColor", customType = "Color")
public void setPlaceholderTextColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHintTextColor(DefaultStyleValuesUtil.getDefaultTextColorHint(view.getContext()));
  } else {
    view.setHintTextColor(color);
  }
}
项目:react-native-text-input    文件:ReactTextInputManager.java   
@ReactProp(name = "selectionColor", customType = "Color")
public void setSelectionColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHighlightColor(DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));
  } else {
    view.setHighlightColor(color);
  }
}
项目:react-native-box-loaders    文件:ReactTextInputManager.java   
@ReactProp(name = "placeholderTextColor", customType = "Color")
public void setPlaceholderTextColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHintTextColor(DefaultStyleValuesUtil.getDefaultTextColorHint(view.getContext()));
  } else {
    view.setHintTextColor(color);
  }
}
项目:react-native-box-loaders    文件:ReactTextInputManager.java   
@ReactProp(name = "selectionColor", customType = "Color")
public void setSelectionColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHighlightColor(DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));
  } else {
    view.setHighlightColor(color);
  }
}
项目:react-native-box-loaders    文件:ReactTextInputManager.java   
@ReactProp(name = ViewProps.COLOR, customType = "Color")
public void setColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setTextColor(DefaultStyleValuesUtil.getDefaultTextColor(view.getContext()));
  } else {
    view.setTextColor(color);
  }
}
项目:Ironman    文件:ReactTextInputManager.java   
@ReactProp(name = "placeholderTextColor", customType = "Color")
public void setPlaceholderTextColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHintTextColor(DefaultStyleValuesUtil.getDefaultTextColorHint(view.getContext()));
  } else {
    view.setHintTextColor(color);
  }
}
项目:Ironman    文件:ReactTextInputManager.java   
@ReactProp(name = "selectionColor", customType = "Color")
public void setSelectionColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setHighlightColor(DefaultStyleValuesUtil.getDefaultTextColorHighlight(view.getContext()));
  } else {
    view.setHighlightColor(color);
  }
}
项目:Ironman    文件:ReactTextInputManager.java   
@ReactProp(name = ViewProps.COLOR, customType = "Color")
public void setColor(ReactEditText view, @Nullable Integer color) {
  if (color == null) {
    view.setTextColor(DefaultStyleValuesUtil.getDefaultTextColor(view.getContext()));
  } else {
    view.setTextColor(color);
  }
}