@@ -14,7 +14,6 @@ import androidx.compose.foundation.clickable
1414import androidx.compose.foundation.gestures.detectVerticalDragGestures
1515import androidx.compose.foundation.layout.Box
1616import androidx.compose.foundation.layout.Column
17- import androidx.compose.foundation.layout.Spacer
1817import androidx.compose.foundation.layout.fillMaxSize
1918import androidx.compose.foundation.layout.fillMaxWidth
2019import androidx.compose.foundation.layout.height
@@ -36,12 +35,13 @@ import androidx.compose.ui.graphics.Color
3635import androidx.compose.ui.input.pointer.pointerInput
3736import androidx.compose.ui.input.pointer.util.VelocityTracker
3837import androidx.compose.ui.layout.onSizeChanged
38+ import androidx.compose.ui.platform.LocalDensity
3939import androidx.compose.ui.unit.IntOffset
40- import androidx.compose.ui.unit.dp
4140import kotlinx.coroutines.launch
4241import to.bitkit.ui.shared.modifiers.sheetHeight
4342import to.bitkit.ui.theme.AppShapes
4443import to.bitkit.ui.theme.Colors
44+ import kotlin.math.abs
4545import kotlin.math.roundToInt
4646
4747private const val MS_DURATION_ANIM = 300
@@ -97,6 +97,18 @@ fun SheetHost(
9797 onClick = { dismiss() },
9898 )
9999
100+ // Fixed background extension - covers gap when sheet drags up
101+ val density = LocalDensity .current
102+ if (sheetVisible && sheetHeightPx > 0f ) {
103+ Box (
104+ modifier = Modifier
105+ .align(Alignment .BottomCenter )
106+ .fillMaxWidth()
107+ .height(with (density) { (sheetHeightPx * abs(OFFSET_MIN_DRAG )).toDp() })
108+ .background(sheetContainerColor)
109+ )
110+ }
111+
100112 AnimatedVisibility (
101113 visible = sheetVisible,
102114 enter = slideInVertically { it } + fadeIn(),
@@ -167,12 +179,6 @@ fun SheetHost(
167179 ) {
168180 content()
169181 }
170- // Extended background tail to cover gap when dragging sheet up
171- Spacer (
172- modifier = Modifier
173- .fillMaxWidth()
174- .height(100 .dp)
175- )
176182 }
177183 }
178184 }
0 commit comments