From 3e16e65222bb2de360d2df1c43b8d07a671ee87d Mon Sep 17 00:00:00 2001 From: Kacper Kafara Date: Thu, 3 Oct 2024 09:53:33 +0200 Subject: [PATCH] fix: align units in different callsites for setting sheet corner radius --- android/src/main/java/com/swmansion/rnscreens/Screen.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/swmansion/rnscreens/Screen.kt b/android/src/main/java/com/swmansion/rnscreens/Screen.kt index b556d115ac..68956f02bc 100644 --- a/android/src/main/java/com/swmansion/rnscreens/Screen.kt +++ b/android/src/main/java/com/swmansion/rnscreens/Screen.kt @@ -16,6 +16,7 @@ import androidx.fragment.app.Fragment import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.facebook.react.bridge.GuardedRunnable import com.facebook.react.bridge.ReactContext +import com.facebook.react.uimanager.PixelUtil import com.facebook.react.uimanager.UIManagerHelper import com.facebook.react.uimanager.UIManagerModule import com.facebook.react.uimanager.events.EventDispatcher @@ -441,12 +442,13 @@ class Screen( return } (background as MaterialShapeDrawable?)?.let { + val resolvedCornerRadius = PixelUtil.toDIPFromPixel(sheetCornerRadius) it.shapeAppearanceModel = ShapeAppearanceModel .Builder() .apply { - setTopLeftCorner(CornerFamily.ROUNDED, sheetCornerRadius) - setTopRightCorner(CornerFamily.ROUNDED, sheetCornerRadius) + setTopLeftCorner(CornerFamily.ROUNDED, resolvedCornerRadius) + setTopRightCorner(CornerFamily.ROUNDED, resolvedCornerRadius) }.build() } }