-
-
Notifications
You must be signed in to change notification settings - Fork 307
Introduce Modifier.balloon() and BalloonState, deprecate Balloon() composable #904
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
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces a new Compose-friendly balloon state management API via Changes
Sequence DiagramsequenceDiagram
actor User
participant Composable
participant BalloonState
participant Modifier.balloon
participant AnchorView
participant BalloonComposeView
participant HostActivity
User->>Composable: Interact with element
Composable->>BalloonState: rememberBalloonState(builder)
BalloonState->>BalloonState: Create from Balloon.Builder<br/>(context, lifecycleOwner)
Composable->>Modifier.balloon: Apply balloon(state, content)
Modifier.balloon->>HostActivity: Create invisible anchor view
Modifier.balloon->>BalloonComposeView: Wire BalloonComposeView<br/>to BalloonState
Modifier.balloon->>Modifier.balloon: onGloballyPositioned callback
Modifier.balloon->>Modifier.balloon: Measure balloon content
Modifier.balloon->>AnchorView: Update position & size
User->>BalloonState: Call showAlignTop()<br/>showAlignBottom(), etc.
BalloonState->>BalloonComposeView: Delegate show operation
BalloonComposeView->>BalloonComposeView: Display balloon<br/>from anchor position
User->>BalloonState: Call dismiss()
BalloonState->>BalloonComposeView: Dismiss balloon
Modifier.balloon->>AnchorView: Remove from activity
BalloonState->>BalloonState: Clean up references
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (18)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Introduce Modifier.balloon() and BalloonState, deprecate Balloon() composable.
Summary by CodeRabbit
New Features
BalloonStateAPI andModifier.balloon()for modern Compose state management and flexible balloon attachments.rememberBalloonState()for managing balloon lifecycle within Compose.Deprecations
Balloon()composable; useModifier.balloon()withrememberBalloonState()instead.BalloonWindowinterface andAwaitBalloonWindowsDsl; migrate toBalloonState.Breaking Changes
showAlignLeft,showAlignRight, etc.); useshowAlignStartandshowAlignEndfor better directional support.✏️ Tip: You can customize this high-level summary in your review settings.