Skip to content

0.4.0

Compare
Choose a tag to compare
@chrisbanes chrisbanes released this 11 Dec 15:56
· 397 commits to main since this release

New API!

I have broken the existing API, but hopefully you can see why. You no longer need to manually calculate bounds. HazeState + Modifier.haze() + Modifier.hazeChild() is all you need.

val hazeState = remember { HazeState() } 

Box {
  LazyColumn(
    modifier = Modifier
      .fillMaxSize()
      .haze(
        // Pass it the HazeState we stored above
        state = hazeState,
        // Need to provide background color of the content
        backgroundColor = MaterialTheme.colorScheme.surface,
      ),
  ) {
    // todo
  }

  Text(
    text = "Content will be blurred behind this",
    modifier = Modifier
      // We use hazeChild on anything where we want the background
      // blurred. We can even provide a shape.
      .hazeChild(
        state = hazeState,
        shape = RoundedCornerShape(16.dp),
      ),
  )
}

What's Changed

Full Changelog: 0.3.1...0.4.0