Fix border-rendering in APIs < 18 cont.

Reviewed By: achen1

Differential Revision: D6418192

fbshipit-source-id: 2186a6103d6542f5ced332d5cb083b1f58bfd43d
This commit is contained in:
Ramanpreet Nara 2017-11-27 17:31:10 -08:00 committed by Facebook Github Bot
parent 0bef872f3f
commit ca7fe72c31
1 changed files with 14 additions and 1 deletions

View File

@ -229,7 +229,20 @@ public class ReactViewGroup extends ViewGroup implements
}
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) {