From 093c89695d4e01cf2ebc3ed8c348e013ed32c5f0 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 e667128272..7bb5ac5269 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() } }