Skip to content

Commit

Permalink
fix: align units in different callsites for setting sheet corner radius
Browse files Browse the repository at this point in the history
  • Loading branch information
kkafar committed Oct 3, 2024
1 parent 2759e05 commit 093c896
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions android/src/main/java/com/swmansion/rnscreens/Screen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}
Expand Down

0 comments on commit 093c896

Please sign in to comment.