Java 类com.facebook.csslayout.CSSConstants 实例源码

项目:ReactNativeSignatureExample    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_RADIUS,
    ViewProps.BORDER_TOP_LEFT_RADIUS,
    ViewProps.BORDER_TOP_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_LEFT_RADIUS
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderRadius(ReactViewGroup view, int index, float borderRadius) {
  if (!CSSConstants.isUndefined(borderRadius)) {
    borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
  }

  if (index == 0) {
    view.setBorderRadius(borderRadius);
  } else {
    view.setBorderRadius(borderRadius, index - 1);
  }
}
项目:react-native-ibeacon-android    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_RADIUS,
    ViewProps.BORDER_TOP_LEFT_RADIUS,
    ViewProps.BORDER_TOP_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_LEFT_RADIUS
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderRadius(ReactViewGroup view, int index, float borderRadius) {
  if (!CSSConstants.isUndefined(borderRadius)) {
    borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
  }

  if (index == 0) {
    view.setBorderRadius(borderRadius);
  } else {
    view.setBorderRadius(borderRadius, index - 1);
  }
}
项目:react-native-box-loaders    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_RADIUS,
    ViewProps.BORDER_TOP_LEFT_RADIUS,
    ViewProps.BORDER_TOP_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_LEFT_RADIUS
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderRadius(ReactViewGroup view, int index, float borderRadius) {
  if (!CSSConstants.isUndefined(borderRadius)) {
    borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
  }

  if (index == 0) {
    view.setBorderRadius(borderRadius);
  } else {
    view.setBorderRadius(borderRadius, index - 1);
  }
}
项目:react-native-box-loaders    文件:ReactImageManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_RADIUS,
    ViewProps.BORDER_TOP_LEFT_RADIUS,
    ViewProps.BORDER_TOP_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_LEFT_RADIUS
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderRadius(ReactImageView view, int index, float borderRadius) {
  if (!CSSConstants.isUndefined(borderRadius)) {
    borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
  }

  if (index == 0) {
    view.setBorderRadius(borderRadius);
  } else {
    view.setBorderRadius(borderRadius, index - 1);
  }
}
项目:Ironman    文件:ReactTextInputManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_RADIUS,
    ViewProps.BORDER_TOP_LEFT_RADIUS,
    ViewProps.BORDER_TOP_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_LEFT_RADIUS
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderRadius(ReactEditText view, int index, float borderRadius) {
  if (!CSSConstants.isUndefined(borderRadius)) {
    borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
  }

  if (index == 0) {
    view.setBorderRadius(borderRadius);
  } else {
    view.setBorderRadius(borderRadius, index - 1);
  }
}
项目:Ironman    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_RADIUS,
    ViewProps.BORDER_TOP_LEFT_RADIUS,
    ViewProps.BORDER_TOP_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_LEFT_RADIUS
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderRadius(ReactViewGroup view, int index, float borderRadius) {
  if (!CSSConstants.isUndefined(borderRadius)) {
    borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
  }

  if (index == 0) {
    view.setBorderRadius(borderRadius);
  } else {
    view.setBorderRadius(borderRadius, index - 1);
  }
}
项目:Ironman    文件:ReactTextViewManager.java   
@ReactPropGroup(names = {
        ViewProps.BORDER_RADIUS,
        ViewProps.BORDER_TOP_LEFT_RADIUS,
        ViewProps.BORDER_TOP_RIGHT_RADIUS,
        ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
        ViewProps.BORDER_BOTTOM_LEFT_RADIUS
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderRadius(ReactTextView view, int index, float borderRadius) {
  if (!CSSConstants.isUndefined(borderRadius)) {
    borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
  }

  if (index == 0) {
    view.setBorderRadius(borderRadius);
  } else {
    view.setBorderRadius(borderRadius, index - 1);
  }
}
项目:Ironman    文件:ReactImageManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_RADIUS,
    ViewProps.BORDER_TOP_LEFT_RADIUS,
    ViewProps.BORDER_TOP_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
    ViewProps.BORDER_BOTTOM_LEFT_RADIUS
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderRadius(ReactImageView view, int index, float borderRadius) {
  if (!CSSConstants.isUndefined(borderRadius)) {
    borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
  }

  if (index == 0) {
    view.setBorderRadius(borderRadius);
  } else {
    view.setBorderRadius(borderRadius, index - 1);
  }
}
项目:ReactNativeSignatureExample    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_WIDTH,
    ViewProps.BORDER_LEFT_WIDTH,
    ViewProps.BORDER_RIGHT_WIDTH,
    ViewProps.BORDER_TOP_WIDTH,
    ViewProps.BORDER_BOTTOM_WIDTH,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderWidth(ReactViewGroup view, int index, float width) {
  if (!CSSConstants.isUndefined(width)) {
    width = PixelUtil.toPixelFromDIP(width);
  }
  view.setBorderWidth(SPACING_TYPES[index], width);
}
项目:ReactNativeSignatureExample    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    "borderColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderBottomColor"
}, customType = "Color")
public void setBorderColor(ReactViewGroup view, int index, Integer color) {
  view.setBorderColor(
      SPACING_TYPES[index],
      color == null ? CSSConstants.UNDEFINED : (float) color);
}
项目:ReactNativeSignatureExample    文件:ReactViewBackgroundDrawable.java   
@Override
public void draw(Canvas canvas) {
  if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    drawRoundedBackgroundWithBorders(canvas);
  } else {
    drawRectangularBackgroundWithBorders(canvas);
  }
}
项目:ReactNativeSignatureExample    文件:ReactViewBackgroundDrawable.java   
@Override
public void getOutline(Outline outline) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    super.getOutline(outline);
    return;
  }
  if((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    updatePath();

    outline.setConvexPath(mPathForBorderRadiusOutline);
  } else {
    outline.setRect(getBounds());
  }
}
项目:ReactNativeSignatureExample    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], radius)) {
    mBorderCornerRadii[position] = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:ReactNativeSignatureExample    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.MARGIN,
    ViewProps.MARGIN_VERTICAL,
    ViewProps.MARGIN_HORIZONTAL,
    ViewProps.MARGIN_LEFT,
    ViewProps.MARGIN_RIGHT,
    ViewProps.MARGIN_TOP,
    ViewProps.MARGIN_BOTTOM,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setMargins(int index, float margin) {
  setMargin(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], PixelUtil.toPixelFromDIP(margin));
}
项目:ReactNativeSignatureExample    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.PADDING,
    ViewProps.PADDING_VERTICAL,
    ViewProps.PADDING_HORIZONTAL,
    ViewProps.PADDING_LEFT,
    ViewProps.PADDING_RIGHT,
    ViewProps.PADDING_TOP,
    ViewProps.PADDING_BOTTOM,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setPaddings(int index, float padding) {
  setPadding(
      ViewProps.PADDING_MARGIN_SPACING_TYPES[index],
      CSSConstants.isUndefined(padding) ? padding : PixelUtil.toPixelFromDIP(padding));
}
项目:ReactNativeSignatureExample    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_WIDTH,
    ViewProps.BORDER_LEFT_WIDTH,
    ViewProps.BORDER_RIGHT_WIDTH,
    ViewProps.BORDER_TOP_WIDTH,
    ViewProps.BORDER_BOTTOM_WIDTH,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderWidths(int index, float borderWidth) {
  setBorder(ViewProps.BORDER_SPACING_TYPES[index], PixelUtil.toPixelFromDIP(borderWidth));
}
项目:react-native-ibeacon-android    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_WIDTH,
    ViewProps.BORDER_LEFT_WIDTH,
    ViewProps.BORDER_RIGHT_WIDTH,
    ViewProps.BORDER_TOP_WIDTH,
    ViewProps.BORDER_BOTTOM_WIDTH,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderWidth(ReactViewGroup view, int index, float width) {
  if (!CSSConstants.isUndefined(width)) {
    width = PixelUtil.toPixelFromDIP(width);
  }
  view.setBorderWidth(SPACING_TYPES[index], width);
}
项目:react-native-ibeacon-android    文件:ReactViewBackgroundDrawable.java   
@Override
public void draw(Canvas canvas) {
  if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    drawRoundedBackgroundWithBorders(canvas);
  } else {
    drawRectangularBackgroundWithBorders(canvas);
  }
}
项目:react-native-ibeacon-android    文件:ReactViewBackgroundDrawable.java   
@Override
public void getOutline(Outline outline) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    super.getOutline(outline);
    return;
  }
  if((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    updatePath();

    outline.setConvexPath(mPathForBorderRadiusOutline);
  } else {
    outline.setRect(getBounds());
  }
}
项目:react-native-ibeacon-android    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], radius)) {
    mBorderCornerRadii[position] = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:react-native-ibeacon-android    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.MARGIN,
    ViewProps.MARGIN_VERTICAL,
    ViewProps.MARGIN_HORIZONTAL,
    ViewProps.MARGIN_LEFT,
    ViewProps.MARGIN_RIGHT,
    ViewProps.MARGIN_TOP,
    ViewProps.MARGIN_BOTTOM,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setMargins(int index, float margin) {
  setMargin(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], PixelUtil.toPixelFromDIP(margin));
}
项目:react-native-ibeacon-android    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.PADDING,
    ViewProps.PADDING_VERTICAL,
    ViewProps.PADDING_HORIZONTAL,
    ViewProps.PADDING_LEFT,
    ViewProps.PADDING_RIGHT,
    ViewProps.PADDING_TOP,
    ViewProps.PADDING_BOTTOM,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setPaddings(int index, float padding) {
  setPadding(
      ViewProps.PADDING_MARGIN_SPACING_TYPES[index],
      CSSConstants.isUndefined(padding) ? padding : PixelUtil.toPixelFromDIP(padding));
}
项目:react-native-ibeacon-android    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_WIDTH,
    ViewProps.BORDER_LEFT_WIDTH,
    ViewProps.BORDER_RIGHT_WIDTH,
    ViewProps.BORDER_TOP_WIDTH,
    ViewProps.BORDER_BOTTOM_WIDTH,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderWidths(int index, float borderWidth) {
  setBorder(ViewProps.BORDER_SPACING_TYPES[index], PixelUtil.toPixelFromDIP(borderWidth));
}
项目:react-native-box-loaders    文件:ReactTextInputShadowNode.java   
@Override
public void measure(
    CSSNode node,
    float width,
    CSSMeasureMode widthMode,
    float height,
    CSSMeasureMode heightMode,
    MeasureOutput measureOutput) {
  // measure() should never be called before setThemedContext()
  EditText editText = Assertions.assertNotNull(mEditText);

  measureOutput.width = widthMode == CSSMeasureMode.UNDEFINED ? CSSConstants.UNDEFINED : width;
  editText.setTextSize(
      TypedValue.COMPLEX_UNIT_PX,
      mFontSize == UNSET ?
          (int) Math.ceil(PixelUtil.toPixelFromSP(ViewDefaults.FONT_SIZE_SP)) : mFontSize);
  mComputedPadding = spacingToFloatArray(getPadding());
  editText.setPadding(
      (int) Math.ceil(getPadding().get(Spacing.LEFT)),
      (int) Math.ceil(getPadding().get(Spacing.TOP)),
      (int) Math.ceil(getPadding().get(Spacing.RIGHT)),
      (int) Math.ceil(getPadding().get(Spacing.BOTTOM)));

  if (mNumberOfLines != UNSET) {
    editText.setLines(mNumberOfLines);
  }

  editText.measure(0 /* unspecified */, 0 /* unspecified */);
  measureOutput.height = editText.getMeasuredHeight();
}
项目:react-native-box-loaders    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_WIDTH,
    ViewProps.BORDER_LEFT_WIDTH,
    ViewProps.BORDER_RIGHT_WIDTH,
    ViewProps.BORDER_TOP_WIDTH,
    ViewProps.BORDER_BOTTOM_WIDTH,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderWidth(ReactViewGroup view, int index, float width) {
  if (!CSSConstants.isUndefined(width)) {
    width = PixelUtil.toPixelFromDIP(width);
  }
  view.setBorderWidth(SPACING_TYPES[index], width);
}
项目:react-native-box-loaders    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    "borderColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderBottomColor"
}, customType = "Color")
public void setBorderColor(ReactViewGroup view, int index, Integer color) {
  view.setBorderColor(
      SPACING_TYPES[index],
      color == null ? CSSConstants.UNDEFINED : (float) color);
}
项目:react-native-box-loaders    文件:ReactViewBackgroundDrawable.java   
@Override
public void draw(Canvas canvas) {
  if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    drawRoundedBackgroundWithBorders(canvas);
  } else {
    drawRectangularBackgroundWithBorders(canvas);
  }
}
项目:react-native-box-loaders    文件:ReactViewBackgroundDrawable.java   
@Override
public void getOutline(Outline outline) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    super.getOutline(outline);
    return;
  }
  if((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    updatePath();

    outline.setConvexPath(mPathForBorderRadiusOutline);
  } else {
    outline.setRect(getBounds());
  }
}
项目:react-native-box-loaders    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], radius)) {
    mBorderCornerRadii[position] = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:react-native-box-loaders    文件:ReactImageView.java   
public void setBorderRadius(float borderRadius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], borderRadius)) {
    mBorderCornerRadii[position] = borderRadius;
    mIsDirty = true;
  }
}
项目:react-native-box-loaders    文件:ReactImageView.java   
private void cornerRadii(float[] computedCorners) {
  float defaultBorderRadius = !CSSConstants.isUndefined(mBorderRadius) ? mBorderRadius : 0;

  computedCorners[0] = mBorderCornerRadii != null && !CSSConstants.isUndefined(mBorderCornerRadii[0]) ? mBorderCornerRadii[0] : defaultBorderRadius;
  computedCorners[1] = mBorderCornerRadii != null && !CSSConstants.isUndefined(mBorderCornerRadii[1]) ? mBorderCornerRadii[1] : defaultBorderRadius;
  computedCorners[2] = mBorderCornerRadii != null && !CSSConstants.isUndefined(mBorderCornerRadii[2]) ? mBorderCornerRadii[2] : defaultBorderRadius;
  computedCorners[3] = mBorderCornerRadii != null && !CSSConstants.isUndefined(mBorderCornerRadii[3]) ? mBorderCornerRadii[3] : defaultBorderRadius;
}
项目:react-native-box-loaders    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.MARGIN,
    ViewProps.MARGIN_VERTICAL,
    ViewProps.MARGIN_HORIZONTAL,
    ViewProps.MARGIN_LEFT,
    ViewProps.MARGIN_RIGHT,
    ViewProps.MARGIN_TOP,
    ViewProps.MARGIN_BOTTOM,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setMargins(int index, float margin) {
  setMargin(ViewProps.PADDING_MARGIN_SPACING_TYPES[index], PixelUtil.toPixelFromDIP(margin));
}
项目:react-native-box-loaders    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.PADDING,
    ViewProps.PADDING_VERTICAL,
    ViewProps.PADDING_HORIZONTAL,
    ViewProps.PADDING_LEFT,
    ViewProps.PADDING_RIGHT,
    ViewProps.PADDING_TOP,
    ViewProps.PADDING_BOTTOM,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setPaddings(int index, float padding) {
  setPadding(
      ViewProps.PADDING_MARGIN_SPACING_TYPES[index],
      CSSConstants.isUndefined(padding) ? padding : PixelUtil.toPixelFromDIP(padding));
}
项目:react-native-box-loaders    文件:LayoutShadowNode.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_WIDTH,
    ViewProps.BORDER_LEFT_WIDTH,
    ViewProps.BORDER_RIGHT_WIDTH,
    ViewProps.BORDER_TOP_WIDTH,
    ViewProps.BORDER_BOTTOM_WIDTH,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderWidths(int index, float borderWidth) {
  setBorder(ViewProps.BORDER_SPACING_TYPES[index], PixelUtil.toPixelFromDIP(borderWidth));
}
项目:Ironman    文件:ReactTextInputManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_WIDTH,
    ViewProps.BORDER_LEFT_WIDTH,
    ViewProps.BORDER_RIGHT_WIDTH,
    ViewProps.BORDER_TOP_WIDTH,
    ViewProps.BORDER_BOTTOM_WIDTH,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderWidth(ReactEditText view, int index, float width) {
  if (!CSSConstants.isUndefined(width)) {
    width = PixelUtil.toPixelFromDIP(width);
  }
  view.setBorderWidth(SPACING_TYPES[index], width);
}
项目:Ironman    文件:ReactTextInputManager.java   
@ReactPropGroup(names = {
    "borderColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderBottomColor"
}, customType = "Color")
public void setBorderColor(ReactEditText view, int index, Integer color) {
  float rgbComponent = color == null ? CSSConstants.UNDEFINED : (float) ((int)color & 0x00FFFFFF);
  float alphaComponent = color == null ? CSSConstants.UNDEFINED : (float) ((int)color >>> 24);
  view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent);
}
项目:Ironman    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    ViewProps.BORDER_WIDTH,
    ViewProps.BORDER_LEFT_WIDTH,
    ViewProps.BORDER_RIGHT_WIDTH,
    ViewProps.BORDER_TOP_WIDTH,
    ViewProps.BORDER_BOTTOM_WIDTH,
}, defaultFloat = CSSConstants.UNDEFINED)
public void setBorderWidth(ReactViewGroup view, int index, float width) {
  if (!CSSConstants.isUndefined(width)) {
    width = PixelUtil.toPixelFromDIP(width);
  }
  view.setBorderWidth(SPACING_TYPES[index], width);
}
项目:Ironman    文件:ReactViewManager.java   
@ReactPropGroup(names = {
    "borderColor", "borderLeftColor", "borderRightColor", "borderTopColor", "borderBottomColor"
}, customType = "Color")
public void setBorderColor(ReactViewGroup view, int index, Integer color) {
  float rgbComponent = color == null ? CSSConstants.UNDEFINED : (float) ((int)color & 0x00FFFFFF);
  float alphaComponent = color == null ? CSSConstants.UNDEFINED : (float) ((int)color >>> 24);
  view.setBorderColor(SPACING_TYPES[index], rgbComponent, alphaComponent);
}
项目:Ironman    文件:ReactViewBackgroundDrawable.java   
@Override
public void draw(Canvas canvas) {
  updatePathEffect();
  boolean roundedBorders = mBorderCornerRadii != null ||
      (!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0);

  if ((mBorderStyle == null || mBorderStyle == BorderStyle.SOLID) && !roundedBorders) {
    drawRectangularBackgroundWithBorders(canvas);
  } else {
    drawRoundedBackgroundWithBorders(canvas);
  }
}
项目:Ironman    文件:ReactViewBackgroundDrawable.java   
@Override
public void getOutline(Outline outline) {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    super.getOutline(outline);
    return;
  }
  if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) {
    updatePath();

    outline.setConvexPath(mPathForBorderRadiusOutline);
  } else {
    outline.setRect(getBounds());
  }
}