From b460f0d20184114e75e4f7f159c812c0af346a3a Mon Sep 17 00:00:00 2001 From: Sergei Dryganets Date: Thu, 27 Sep 2018 08:02:47 -0700 Subject: [PATCH] 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: https://github.com/facebook/react-native/pull/21340 Differential Revision: D10084318 Pulled By: hramos fbshipit-source-id: 53ae5a32b96cc7ee7eba084330682239d8beb85d --- .../com/facebook/react/views/view/ReactViewGroup.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java index 352e5ee5bca15e..56ab14fe72ff42 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java @@ -239,8 +239,7 @@ public void setBorderRadius(float 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) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2 || Build.VERSION.SDK_INT == Build.VERSION_CODES.N) { final int UPDATED_LAYER_TYPE = backgroundDrawable.hasRoundedBorders() ? View.LAYER_TYPE_SOFTWARE @@ -255,9 +254,8 @@ public void setBorderRadius(float borderRadius) { public void setBorderRadius(float borderRadius, int position) { ReactViewBackgroundDrawable backgroundDrawable = getOrCreateReactViewBackground(); backgroundDrawable.setRadius(borderRadius, position); - - if (Build.VERSION_CODES.HONEYCOMB < Build.VERSION.SDK_INT - && Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { + + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2 || Build.VERSION.SDK_INT == Build.VERSION_CODES.N) { final int UPDATED_LAYER_TYPE = backgroundDrawable.hasRoundedBorders() ? View.LAYER_TYPE_SOFTWARE