Open amatanat opened 11 months ago
@amatanat Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
google-maps
tagThis is an automated message, feel free to ignore.
Hi @amatanat ,
Could you try setting the shape directly in the Card
Composable?
Card(modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(40.dp))
If this does not work, can you provide a snippet where this can be reproduced? Particularly interested in checking how the ModalBottomSheet
is set.
Hi @kikoso,
The suggestion above doesn't work. Here is a snipped with the ModalBottomSheet
:
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
val sheetShape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp)
ModalBottomSheet(
onDismissRequest = {},
sheetState = sheetState,
shape = sheetShape,
tonalElevation = 0.dp,
dragHandle = null,
windowInsets = ScaffoldDefaults.contentWindowInsets.exclude(ScaffoldDefaults.contentWindowInsets.only(WindowInsetsSides.Top)).exclude(ScaffoldDefaults.contentWindowInsets.only(WindowInsetsSides.Bottom)),
) {
val cameraPositionState = rememberStreetViewCameraPositionState()
StreetView(
modifier = Modifier
.clip(RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp))
.height(150.dp),
cameraPositionState = cameraPositionState,
streetViewPanoramaOptionsFactory = {
StreetViewPanoramaOptions().position(LatLng(1.1, 2.2), StreetViewSource.OUTDOOR)
},
)
}
StreetView composable doesn't fully respect the parent's and its own clip area.
Environment details
We tested it in Android 13 & 14.
Versions:
Steps to reproduce
Put the
StreetView
inside aCard
orModalBottomSheet
with rounded corners where the street view fills out to each side. The street view will be drawn outside of the rounded corners, no matter if you putModifier.clip
on theStreetView
itself or the parent Composable.Also tried adding
shape
to theCard
and noModifier.clip
applied on theStreetView
, but got the same result.ℹ️ There was the same bug report for the Composable
GoogleMap
which isClosed
now but there is a comment that it still doesn't work.Code example
Example screenshot from a
ModalBottomSheet
withRoundedCornerShape(topStart = 20.dp, topEnd = 20.dp)
shape andModifier.clip(RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp))
applied toStreetView
.