Balloon icon indicating copy to clipboard operation
Balloon copied to clipboard

Compose Balloon position is misplace

Open waheedkhan-dev opened this issue 2 years ago • 4 comments

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

waheedkhan-dev avatar Jan 30 '24 03:01 waheedkhan-dev

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

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

skydoves avatar Jan 30 '24 04:01 skydoves

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

waheedkhan-dev avatar Jan 31 '24 03:01 waheedkhan-dev

@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

TomTruyen avatar Feb 15 '24 10:02 TomTruyen

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.

jasminvucelj avatar Apr 18 '24 21:04 jasminvucelj

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

skydoves avatar Jun 16 '24 05:06 skydoves

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: @.***>

waheedkhan-dev avatar Jun 16 '24 06:06 waheedkhan-dev