Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion android/src/main/java/com/swmansion/rnscreens/Screen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import com.swmansion.rnscreens.events.SheetDetentChangedEvent
import com.swmansion.rnscreens.ext.asScreenStackFragment
import com.swmansion.rnscreens.ext.parentAsViewGroup
import com.swmansion.rnscreens.gamma.common.FragmentProviding
import kotlin.math.max

@SuppressLint("ViewConstructor") // Only we construct this view, it is never inflated.
class Screen(
Expand Down Expand Up @@ -518,7 +519,7 @@ class Screen(
return
}
(background as? MaterialShapeDrawable?)?.let {
val resolvedCornerRadius = PixelUtil.toDIPFromPixel(sheetCornerRadius)
val resolvedCornerRadius = max(PixelUtil.toDIPFromPixel(sheetCornerRadius), 0f)
it.shapeAppearanceModel =
ShapeAppearanceModel
.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.swmansion.rnscreens.stack.views.ScreensCoordinatorLayout
import com.swmansion.rnscreens.transition.ExternalBoundaryValuesEvaluator
import com.swmansion.rnscreens.utils.DeviceUtils
import com.swmansion.rnscreens.utils.resolveBackgroundColor
import kotlin.math.max

sealed class KeyboardState

Expand Down Expand Up @@ -367,7 +368,7 @@ class ScreenStackFragment :
}

private fun attachShapeToScreen(screen: Screen) {
val cornerSize = PixelUtil.toPixelFromDIP(screen.sheetCornerRadius)
val cornerSize = max(PixelUtil.toPixelFromDIP(screen.sheetCornerRadius), 0f)
val shapeAppearanceModel =
ShapeAppearanceModel
.Builder()
Expand Down
Loading