Skip to content

Commit b460f0d

Browse files
dryganetsgrabbou
authored andcommitted
Rounded corner rendering fixed on Android N. (#21340)
Summary: On Android N (API 24) rounded corners rendering has issues in case scale factor is set for the view. Pull Request resolved: #21340 Differential Revision: D10084318 Pulled By: hramos fbshipit-source-id: 53ae5a32b96cc7ee7eba084330682239d8beb85d
1 parent ddce06f commit b460f0d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ public void setBorderRadius(float borderRadius) {
239239
ReactViewBackgroundDrawable backgroundDrawable = getOrCreateReactViewBackground();
240240
backgroundDrawable.setRadius(borderRadius);
241241

242-
if (Build.VERSION_CODES.HONEYCOMB < Build.VERSION.SDK_INT
243-
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
242+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2 || Build.VERSION.SDK_INT == Build.VERSION_CODES.N) {
244243
final int UPDATED_LAYER_TYPE =
245244
backgroundDrawable.hasRoundedBorders()
246245
? View.LAYER_TYPE_SOFTWARE
@@ -255,9 +254,8 @@ public void setBorderRadius(float borderRadius) {
255254
public void setBorderRadius(float borderRadius, int position) {
256255
ReactViewBackgroundDrawable backgroundDrawable = getOrCreateReactViewBackground();
257256
backgroundDrawable.setRadius(borderRadius, position);
258-
259-
if (Build.VERSION_CODES.HONEYCOMB < Build.VERSION.SDK_INT
260-
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
257+
258+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2 || Build.VERSION.SDK_INT == Build.VERSION_CODES.N) {
261259
final int UPDATED_LAYER_TYPE =
262260
backgroundDrawable.hasRoundedBorders()
263261
? View.LAYER_TYPE_SOFTWARE

0 commit comments

Comments
 (0)