Skip to content

Commit

Permalink
Rounded corner rendering fixed on Android N. (#21340)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dryganets authored and facebook-github-bot committed Sep 27, 2018
1 parent 4750f52 commit 748cf82
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,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
Expand All @@ -254,9 +253,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
Expand Down

0 comments on commit 748cf82

Please sign in to comment.