Skip to content

Commit 748cf82

Browse files
dryganetsfacebook-github-bot
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 4750f52 commit 748cf82

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ public void setBorderRadius(float borderRadius) {
238238
ReactViewBackgroundDrawable backgroundDrawable = getOrCreateReactViewBackground();
239239
backgroundDrawable.setRadius(borderRadius);
240240

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

0 commit comments

Comments
 (0)