Skip to content

Conversation

@skydoves
Copy link
Owner

@skydoves skydoves commented Jan 9, 2026

Calculate transition x, y values for the showAsDropDown (#919)

Summary by CodeRabbit

  • Bug Fixes

    • Fixed balloon positioning to correctly account for translated anchor views, ensuring popups display at the expected location regardless of anchor transform state.
  • Refactor

    • Simplified internal calculation logic for improved code maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

@skydoves skydoves self-assigned this Jan 9, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

The changes add support for anchor view translation when positioning balloons. The code now accounts for the anchor's translationX and translationY across show logic, update logic, overlay positioning, and coordinate calculation methods.

Changes

Cohort / File(s) Summary
Code Refactoring
balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/BalloonModifier.kt
Collapses multi-line effectiveMaxHeight calculation into a single-line if-else expression; removes preceding comment
Translation-Aware Positioning
balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt, balloon/src/main/kotlin/com/skydoves/balloon/extensions/ViewExtension.kt, balloon/src/main/kotlin/com/skydoves/balloon/overlay/BalloonAnchorOverlayView.kt
Adjusts balloon positioning logic to include anchor's translationX and translationY when computing offsets in show/update flows and overlay bounds calculation; updates getViewPointOnScreen() to return translated coordinates

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Poem

🐰 A hop, a skip, translation in place—
Balloons now follow anchors with grace!
No more displaced, no more adrift,
With translationX and Y, what a gift! ✨

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41ef710 and 5b61ab1.

📒 Files selected for processing (4)
  • balloon-compose/src/main/kotlin/com/skydoves/balloon/compose/BalloonModifier.kt
  • balloon/src/main/kotlin/com/skydoves/balloon/Balloon.kt
  • balloon/src/main/kotlin/com/skydoves/balloon/extensions/ViewExtension.kt
  • balloon/src/main/kotlin/com/skydoves/balloon/overlay/BalloonAnchorOverlayView.kt

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@skydoves skydoves merged commit b22a0bf into main Jan 9, 2026
4 of 5 checks passed
@skydoves skydoves deleted the fix/transitions branch January 9, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants