Balloon
Balloon copied to clipboard
Compose: arrow position is wrong
Please complete the following information:
- v1.6.1
- all? maybe related to https://github.com/skydoves/Balloon/issues/413
Describe the Bug:
The arrow is not correctly pointing to the middle of anchor.
Expected Behavior:
The arrow is correctly pointing to the middle of anchor.
val builder = rememberBalloonBuilder {
setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
setArrowPosition(0.5f)
setMarginHorizontal(12)
}
var balloonWindow1: BalloonWindow? by remember { mutableStateOf(null) }
Column {
Spacer(modifier = Modifier.height(300.dp))
Box(
modifier = Modifier
.padding(horizontal = 12.dp) // changing this to a larger value like 36.dp will work for the arrow
) {
Balloon(
builder = builder,
balloonContent = {
Text(
modifier = Modifier.fillMaxWidth(),
text = "Now you can edit your profile1 profile2 profile3 profile4",
color = Color.White,
)
},
) { balloonWindow ->
LaunchedEffect(key1 = Unit) {
balloonWindow1 = balloonWindow
}
Button(
modifier = Modifier
.padding(horizontal = 0.dp)
.size(48.dp, 48.dp),
onClick = { balloonWindow1?.showAlignTop(yOff = 20) },
) {
Text(text = "|")
}
}
}
}
12.dp:
36.dp:
heyho @skydoves :) do you have any news on that - the impact is huge if you have more padding in the inside and have larger text and other content on the screen. Happens more often than you expect
Hery @alexanderfilipzik, sorry for the delayed response. A new version 1.6.4 has been released, and I'm wondering if this issue still happens in that version.