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: arrow position is wrong #514

Open
alexanderfilipzik opened this issue Oct 19, 2023 · 2 comments
Open

Compose: arrow position is wrong #514

alexanderfilipzik opened this issue Oct 19, 2023 · 2 comments
Labels
compose Jetpack Compose Issue

Comments

@alexanderfilipzik
Copy link

alexanderfilipzik commented Oct 19, 2023

Please complete the following information:

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:
Bildschirmfoto 2023-10-19 um 09 54 24

36.dp:
Bildschirmfoto 2023-10-19 um 09 54 40

@skydoves skydoves added the compose Jetpack Compose Issue label Nov 3, 2023
@alexanderfilipzik
Copy link
Author

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

@skydoves
Copy link
Owner

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.

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

2 participants