Skip to content

Commit

Permalink
code review from shergin
Browse files Browse the repository at this point in the history
  • Loading branch information
fabOnReact committed Feb 24, 2021
1 parent aa4df8c commit e1fc40e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ public void setBorderColor(int position, float rgb, float alpha) {
public void setBorderRadius(float borderRadius) {
ReactViewBackgroundDrawable backgroundDrawable = getOrCreateReactViewBackground();
backgroundDrawable.setRadius(borderRadius);
// for sdk 24-28 fix issue with clipPath and LAYER_TYPE_NONE
// https://github.com/facebook/react-native/issues/18266
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
&& Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
setLayerType(View.LAYER_TYPE_HARDWARE, null);
}
}

public void setBorderRadius(float borderRadius, int position) {
Expand Down Expand Up @@ -866,12 +872,6 @@ private void dispatchOverflowDraw(Canvas canvas) {
Math.max(bottomLeftBorderRadius - borderWidth.bottom, 0),
},
Path.Direction.CW);
// for sdk 24-28 fix issue with clipPath and LAYER_TYPE_NONE
// https://github.com/facebook/react-native/issues/18266
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
&& Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
setLayerType(View.LAYER_TYPE_HARDWARE, null);
}
canvas.clipPath(mPath);
hasClipPath = true;
}
Expand Down

0 comments on commit e1fc40e

Please sign in to comment.