skydoves / Balloon

:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android.
https://skydoves.github.io/libraries/balloon/html/balloon/com.skydoves.balloon/index.html
Apache License 2.0
3.69k stars 289 forks source link

Compose Balloon position is misplace #586

Closed waheedkhan-dev closed 1 month ago

waheedkhan-dev commented 7 months ago

Please complete the following information:

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 commented 7 months ago

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

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

waheedkhan-dev commented 7 months ago

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 commented 7 months ago

@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 commented 4 months ago

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.

skydoves commented 2 months ago

Hey guys, balloon 1.6.5 has been released. Would you please check it out to see if this issue still occurs? Thank you!

waheedkhan-dev commented 2 months ago

Ok let me check

On Sun, 16 Jun 2024, 10:31 am Jaewoong Eum, @.***> wrote:

Hey guys, balloon 1.6.5 has been released. Would you please check it out to see if this issue still occurs? Thank you!

— Reply to this email directly, view it on GitHub https://github.com/skydoves/Balloon/issues/586#issuecomment-2171055926, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANFMC2JK5KKTQ4HEOWORJC3ZHUPMXAVCNFSM6AAAAABCQREJD2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZRGA2TKOJSGY . You are receiving this because you were mentioned.Message ID: @.***>