Permalink
Browse files

Fix border-rendering in APIs < 18 cont.

Reviewed By: achen1

Differential Revision: D6418192

fbshipit-source-id: 2186a6103d6542f5ced332d5cb083b1f58bfd43d
  • Loading branch information...
RSNara authored and facebook-github-bot committed Nov 28, 2017
1 parent 0bef872 commit ca7fe72c31fd7c7cbe4734118019f5808235560e
Showing with 14 additions and 1 deletion.
  1. +14 −1 ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java
@@ -229,7 +229,20 @@ public void setBorderColor(int position, float rgb, float alpha) {
}
public void setBorderRadius(float borderRadius) {
getOrCreateReactViewBackground().setRadius(borderRadius);
ReactViewBackgroundDrawable backgroundDrawable = getOrCreateReactViewBackground();
backgroundDrawable.setRadius(borderRadius);
if (Build.VERSION_CODES.HONEYCOMB < Build.VERSION.SDK_INT
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
final int UPDATED_LAYER_TYPE =
backgroundDrawable.hasRoundedBorders()
? View.LAYER_TYPE_SOFTWARE
: View.LAYER_TYPE_HARDWARE;
if (UPDATED_LAYER_TYPE != getLayerType()) {
setLayerType(UPDATED_LAYER_TYPE, null);
}
}
}
public void setBorderRadius(float borderRadius, int position) {

0 comments on commit ca7fe72

Please sign in to comment.