skydoves / Balloon

:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android.

Home Page:https://skydoves.github.io/libraries/balloon/html/balloon/com.skydoves.balloon/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compose: provide the way to get the end of the sequentially showed balloons.

Monabr opened this issue · comments

commented

I need to show tooltips after first open app only one time. I am using "Show up Balloon Sequentially" but how can I get the end of this? I need to write it only after last balloon is dismissed. This is because of recomposition. The last balloon will be canceled too early because of my property will change view in compose.

Hey @Monabr, you can control sequential balloons more accurately by using await_ functions.

coroutineScope.launch {
  customListBalloon.awaitAlignBottom(anchorView)
  customProfileBalloon.awaitAlignBottom(circleImageView, 0, 0)
  customTagBalloon.awaitAlignTop(bottomNavigationView, 130, 0)
}
commented

@skydoves Yea, but how can I know when the last one is closed?

You can use the setOnBalloonDismissListener for listening a specific balloon was closed. You can only set the listener for the last one.

commented

You can use the setOnBalloonDismissListener for listening a specific balloon was closed. You can only set the listener for the last one.

@skydoves This not working when I use .await_

This mentioned in your docs.

Ah, then this should be reported as a bug. I will let you know for the updates soon.

This issue has been fixed in the current snapshot version. It will be contained in the next stable release. Thanks for reporting this!

commented

@skydoves Thank you. Please also update the docs. This line:

Note: The relayShow__ and await__ methods overwrite the setOnDismissListener internally, so you can't use the setOnDismissListener at the same time.

Thanks for pointing out this issue @Monabr. In the next release, you can use the setOnDismissListener regardless of the internal usage.

@Monabr 1.6.3 has been released, and now setOnDismissListener works as you expected. Thanks for reporting this issue 👍

commented

@skydoves I reopen the issue about this problem by the new issue #549