Skip to content
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

Compose Balloon position is misplace #586

Open
waheedkhan-dev opened this issue Jan 30, 2024 · 4 comments
Open

Compose Balloon position is misplace #586

waheedkhan-dev opened this issue Jan 30, 2024 · 4 comments
Labels
compose Jetpack Compose Issue

Comments

@waheedkhan-dev
Copy link

Please complete the following information:

  • Library Version [e.g. 1.6.4]
  • Affected Device(s) [e.g. Samsung Galaxy s9 with Android 8.0]

Describe the Bug:

I am using Balloon in my compose project. Library is working fine on above android 10 but when i test it on android 8 it behave like this

image
@skydoves
Copy link
Owner

Hey @waheedkhan-dev, thanks for reporting your issue.

Would you share your code base and the expected result? Thank you!

@waheedkhan-dev
Copy link
Author

MY Balloon Content look like this

val builder = rememberBalloonBuilder {
setArrowSize(10)
setArrowPosition(0.5f)
setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
setWidth(BalloonSizeSpec.WRAP)
setHeight(BalloonSizeSpec.WRAP)
setPadding(12)
setMarginHorizontal(12)
setCornerRadius(8f)
setIsVisibleOverlay(true)
setBackgroundColorResource(R.color.white)
setOverlayColorResource(R.color.app_secondary)
setBalloonAnimation(BalloonAnimation.ELASTIC)

}

Balloon(
    builder = builder,
    balloonContent = {
        Text(
            toolTipText,
            style = TextStyle(
                fontFamily = workSansFamily,
                fontWeight = FontWeight.Normal,
                fontSize = 12.sp,
                color = MaterialTheme.colorScheme.secondary,
                textAlign = TextAlign.Start
            )
        )
    }
) { balloonWindow ->
    IconButton(onClick = {
        balloonWindow.showAlignTop()
    }) {
        Icon(
            painter = icon,
            contentDescription = null,
            tint = MaterialTheme.colorScheme.secondary
        )
    }
}

Expecxted result
image

@TomTruyen
Copy link

@skydoves it seems that since the latest version something with the positioning has broken.

I had to upgrade to 1.6.4 to get the setWidthRatio to work as it didn't before, but since 1.6.4 the alignment does not work correctly anymore

@jasminvucelj
Copy link

Can confirm, offsets and positions are broken on 1.6.4 with Compose, had to downgrade to 1.6.3 to get it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compose Jetpack Compose Issue
Projects
None yet
Development

No branches or pull requests

4 participants