diff --git a/balloon-compose/api/balloon-compose.api b/balloon-compose/api/balloon-compose.api index e2cf49d3..5e70187a 100644 --- a/balloon-compose/api/balloon-compose.api +++ b/balloon-compose/api/balloon-compose.api @@ -79,7 +79,7 @@ public final class com/skydoves/balloon/compose/ComposableSingletons$BalloonComp } public final class com/skydoves/balloon/compose/RememberBalloonBuilderKt { - public static final fun rememberBalloonBuilder (Landroid/content/Context;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)Lcom/skydoves/balloon/Balloon$Builder; + public static final fun rememberBalloonBuilder (Ljava/lang/Object;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)Lcom/skydoves/balloon/Balloon$Builder; public static final fun rememberBalloonWindow (Lcom/skydoves/balloon/compose/BalloonWindow;Ljava/lang/Object;Landroidx/compose/runtime/Composer;II)Landroidx/compose/runtime/MutableState; } diff --git a/balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/RememberBalloonBuilder.kt b/balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/RememberBalloonBuilder.kt index 40a5c1ac..b3e1f9b3 100644 --- a/balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/RememberBalloonBuilder.kt +++ b/balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/RememberBalloonBuilder.kt @@ -30,15 +30,17 @@ internal annotation class BalloonDsl /** * Create and remember [Balloon.Builder]. * + * @param key The key that may trigger recomposition. * @param context context to create balloon. * @param block a receiver lambda that will be applied with [Balloon.Builder]. */ @Composable @BalloonDsl public fun rememberBalloonBuilder( + key: Any? = null, context: Context = LocalContext.current, block: Balloon.Builder.() -> Unit, -): Balloon.Builder = remember { +): Balloon.Builder = remember(key) { Balloon.Builder(context).apply(block) }