Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,9 @@ class SuperwallPaywallActivity : AppCompatActivity() {
val content = contentView as ViewGroup
val bottomSheetBehavior = BottomSheetBehavior.from(content.getChildAt(0))
if (!isModal) {
bottomSheetBehavior.halfExpandedRatio =
(if (height > 1.0) height / 100 else height).toFloat()
val normalizedHeight = (if (height > 1.0) height / 100 else height).toFloat()
// Clamp to (0, 1) since 0.0 = STATE_COLLAPSED and 1.0 = STATE_EXPANDED
bottomSheetBehavior.halfExpandedRatio = normalizedHeight.coerceIn(0.01f, 0.99f)
} else {
// If it's a Modal, we want it to cover only 95% of the screen when expanded
content.updateLayoutParams {
Expand Down
Loading