-
-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Balloon-Compose height issue #469
Comments
I mention here this comment describing the same issue. |
Good! Exactly the same issue I'm facing, and I'm using it in a TopAppBar too, it may be related to the bar then.
|
I have a similar issue. |
Hey @isansc lobo @kostapostolakis @gaborrosta guys, sorry for the very delayed response. A new version 1.6.0 has been released, please check it out the new version still produces the same issue. Thank you! |
@skydoves |
With the given example by @isansc, it seems to work well. @gaborrosta Would you give me any other examples? You can provide any samples with gist. |
@skydoves @Composable
fun Example() {
val interactionSource = remember { MutableInteractionSource() }
val backgroundColor = MaterialTheme.colors.secondary.toArgb()
val builder = rememberBalloonBuilder {
this.backgroundColor = backgroundColor
this.setHeight(BalloonSizeSpec.WRAP)
}
Balloon(
builder = builder,
balloonContent = {
Text(
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.",
modifier = Modifier
.padding(all = 8.dp),
)
},
) { balloonWindow ->
Row(
modifier = Modifier
.fillMaxWidth()
.clickable(
interactionSource = interactionSource,
indication = LocalIndication.current,
onClick = {},
)
.padding(end = 8.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Checkbox(
checked = true,
onCheckedChange = null,
modifier = Modifier
.padding(all = 12.dp),
)
Text(
text = "Lorem ipsum",
modifier = Modifier
.weight(weight = 1f),
)
IconButton(
onClick = { balloonWindow.showAlignBottom() },
) {
Icon(
imageVector = Icons.Filled.Info,
contentDescription = "Info",
)
}
}
}
} |
It was fixed in compose. Thanks! |
@kostapostolakis Thanks for checking this issue! |
@gaborrosta Are you sure you're using 1.6.0? My Samsung devices (S10, S23) works really work: ![]() |
@gaborrosta I hope you try the builder below: val builder = rememberBalloonBuilder {
setArrowSize(10)
setWidth(BalloonSizeSpec.WRAP)
setHeight(BalloonSizeSpec.WRAP)
setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
setArrowPosition(0.5f)
setPadding(12)
setMarginHorizontal(12)
setTextSize(15f)
setCornerRadius(8f)
setBackgroundColorResource(R.color.skyBlue)
setBalloonAnimation(BalloonAnimation.ELASTIC)
setIsVisibleOverlay(true)
setOverlayColorResource(R.color.overlay)
setOverlayPaddingResource(R.dimen.editBalloonOverlayPadding)
setBalloonHighlightAnimation(BalloonHighlightAnimation.SHAKE)
setOverlayShape(
BalloonOverlayRoundRect(
R.dimen.editBalloonOverlayRadius,
R.dimen.editBalloonOverlayRadius,
),
)
setDismissWhenClicked(true)
} |
@skydoves Yes. |
That's weird.. Balloon(
modifier = Modifier
.padding(20.dp)
.align(Alignment.Center),
builder = rememberBalloonBuilder {
setBackgroundColorResource(R.color.skyBlue)
setHeight(BalloonSizeSpec.WRAP)
},
balloonContent = {
Text(
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.",
modifier = Modifier
.padding(all = 8.dp),
)
},
) { balloonWindow ->
Button(
modifier = Modifier.size(160.dp, 60.dp),
onClick = { balloonWindow1.showAlignTop() },
) {
Text(text = "showAlignTop")
}
} Result: (Pixel 4a API 32) |
@skydoves But if I add padding even in the Interestingly, I tried with different padding rather than I hope this explanation helps you with finding the solution. |
Hey guys, a new version, 1.6.4, has been released. I'm wondering if this issue still happens in the new version. Thank you for your time in advance! |
@skydoves I've tried the new version and it seems it is working now. Thank you for the fix! |
@gaborrosta Thanks for checking this! I'm closing this issue now. If you still face any similar issue with this, please reopen this issue anytime. |
@skydoves This issue should be reopened. When setting the "setWidthRatio" to for example: 0.8f it breaks again |
Discussed in #468
Originally posted by isansc August 15, 2023
I'm trying to use the compose version of balloon and its height seems to have some limit. It seems to be the same problem that the xml version faced in this issue: #148
It doesn't work even when I set a height value (e.g. 500)
But in my case I'm using the Compose version.
Below is the simple code I'm using based on the Medium arcticle:
`
val context = LocalContext.current
// ToolTip Builder:
val builder = rememberBalloonBuilder {
setArrowSize(16)
setArrowColorMatchBalloon(true)
setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
// setArrowPosition(0.5f)
setTextColor(Color.Black)
setWidth(BalloonSizeSpec.WRAP)
setHeight(BalloonSizeSpec.WRAP)
setPadding(12)
setCornerRadius(12f)
setBackgroundColor(White)
setBalloonAnimation(BalloonAnimation.ELASTIC)
setIsVisibleOverlay(true)
setOverlayColor(Overlay)
setBalloonHighlightAnimation(BalloonHighlightAnimation.NONE)
setDismissWhenClicked(true)
}
[...]
`
The text was updated successfully, but these errors were encountered: