Java Code Examples for com.facebook.react.uimanager.ViewProps#FONT_FAMILY

The following examples show how to use com.facebook.react.uimanager.ViewProps#FONT_FAMILY . 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: ReactAztecManager.java    From react-native-aztec with GNU General Public License v2.0 5 votes vote down vote up
@ReactProp(name = ViewProps.FONT_FAMILY)
public void setFontFamily(ReactAztecText view, String fontFamily) {
    int style = Typeface.NORMAL;
    if (view.getTypeface() != null) {
        style = view.getTypeface().getStyle();
    }
    Typeface newTypeface = ReactFontManager.getInstance().getTypeface(
            fontFamily,
            style,
            view.getContext().getAssets());
    view.setTypeface(newTypeface);
}
 
Example 2
Source File: ReactTextInputManager.java    From react-native-GPay with MIT License 5 votes vote down vote up
@ReactProp(name = ViewProps.FONT_FAMILY)
public void setFontFamily(ReactEditText view, String fontFamily) {
  int style = Typeface.NORMAL;
  if (view.getTypeface() != null) {
    style = view.getTypeface().getStyle();
  }
  Typeface newTypeface = ReactFontManager.getInstance().getTypeface(
      fontFamily,
      style,
      view.getContext().getAssets());
  view.setTypeface(newTypeface);
}
 
Example 3
Source File: ReactBaseTextShadowNode.java    From react-native-GPay with MIT License 4 votes vote down vote up
@ReactProp(name = ViewProps.FONT_FAMILY)
public void setFontFamily(@Nullable String fontFamily) {
  mFontFamily = fontFamily;
  markUpdated();
}