1.7.0
Release Notes for Balloon 1.7.0.
New Features
- Introduce Modifier.balloon() and BalloonState for Jetpack Compose (#904)
- New modifier-based API for attaching balloon tooltips to composables
- rememberBalloonState() for managing balloon state
- Deprecates the Balloon() composable and BalloonWindow interface
- Support individual properties for BalloonOverlayRoundRect (#903)
- Allows setting individual corner radii for overlay round rectangles
- Implement effective arrow sizes (#900)
- Better arrow size calculations for improved positioning
Now, the Balloon composable function will be deprecated. Migration guides from Balloon composable to Modifier.balloon():
Before (Deprecated)
var balloonWindow: BalloonWindow? by remember { mutableStateOf(null) }
Balloon(
builder = builder,
onBalloonWindowInitialized = { balloonWindow = it },
onComposedAnchor = { balloonWindow?.showAlignTop() },
balloonContent = {
Text(text = "Tooltip content")
},
) {
Button(onClick = { balloonWindow?.showAlignTop() }) {
Text(text = "Show Balloon")
}
}
After (New API)
val balloonState = rememberBalloonState(builder)
LaunchedEffect(Unit) {
balloonState.showAlignTop()
}
Button(
modifier = Modifier.balloon(balloonState) {
Text(text = "Tooltip content")
},
onClick = { balloonState.showAlignTop() },
) {
Text(text = "Show Balloon")
}
Bug Fixes and Improvements
- Disable focus to prevent focus highlight on D-pad navigation (#902)
- Apply stroke/border in non-clipped mode as well (#901)
- Migrate to Subcompose layout to measure layout sizes (#898)
- Fixes black screen issue during SplashScreen (#786)
- Correct measuring logic with adjusted padding sequences (#897)
- Use EXACTLY mode for fixed heights, AT_MOST for wrap content (#896)
- Fixes nested layout measurement issues
- Fix: Clear any theme-applied background tint (#893)
Deprecations
The following APIs are now deprecated in favor of the new Modifier.balloon() API:
- Balloon() composable - Use Modifier.balloon() with rememberBalloonState()
- BalloonWindow interface - Use BalloonState
- rememberBalloonWindow() - Use rememberBalloonState()
- awaitBalloonWindows() and AwaitBalloonWindowsDsl