HazeEffectNode

The Modifier.Node implementation used by Modifier.hazeEffect.

This is public API in order to aid custom extensible modifiers, but we reserve the right to be able to change the API in the future, hence why it is marked as experimental forever.

Constructors

Link copied to clipboard
constructor(state: HazeState? = null, style: HazeStyle = HazeStyle.Unspecified, block: HazeEffectScope.() -> Unit? = null)

Properties

Link copied to clipboard
open override var alpha: Float

The opacity that the overall effect will drawn with, in the range of 0..1.

Link copied to clipboard
open override var backgroundColor: Color

Color to draw behind the blurred content. Ideally should be opaque so that the original content is not visible behind. Typically this would be MaterialTheme.colorScheme.surface or similar.

Link copied to clipboard
Link copied to clipboard
open override var blurEnabled: Boolean

Whether the blur effect is enabled or not, when running on platforms which support blurring.

Link copied to clipboard
open override var blurRadius: Dp

Radius of the blur.

Link copied to clipboard

The BlurredEdgeTreatment to use when blurring content.

Link copied to clipboard
open override var canDrawArea: (HazeArea) -> Boolean?

A block which controls whether this hazeEffect should draw the given HazeArea.

Link copied to clipboard
val coroutineScope: CoroutineScope
Link copied to clipboard
open override var drawContentBehind: Boolean

Whether to draw the content behind the blurred effect for foreground blurring. This is sometimes useful when you're using a mask or progressive effect.

Link copied to clipboard
open override var fallbackTint: HazeTint

The HazeTint to use when Haze uses the fallback scrim functionality.

Link copied to clipboard
open override var inputScale: HazeInputScale

The input scale factor, which needs to be in the range 0 < x <= 1. Defaults to 1.0, resulting in no scaling.

Link copied to clipboard
Link copied to clipboard
open override var mask: Brush?

Optional alpha mask which allows effects such as fading via a Brush.verticalGradient or similar. This is only applied when progressive is null.

Link copied to clipboard
override var node: Modifier.Node
Link copied to clipboard
open override var noiseFactor: Float

Amount of noise applied to the content, in the range 0f to 1f. Anything outside of that range will be clamped.

Link copied to clipboard
open override var progressive: HazeProgressive?

Parameters for enabling a progressive (or gradient) blur effect, or null for a uniform blurring effect. Defaults to null.

Link copied to clipboard
open override val shouldAutoInvalidate: Boolean = false
Link copied to clipboard
Link copied to clipboard
open override var style: HazeStyle

Style set on this specific HazeEffectNode.

Link copied to clipboard
open override var tints: List<HazeTint>

The HazeTints to apply to the blurred content.

Link copied to clipboard
open override val traverseKey: Any

Functions

Link copied to clipboard
open override fun ContentDrawScope.draw()
Link copied to clipboard
open override fun onAttach()
Link copied to clipboard
open fun onDensityChange()
Link copied to clipboard
open fun onDetach()
Link copied to clipboard
open override fun onGloballyPositioned(coordinates: LayoutCoordinates)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun onObservedReadsChanged()
Link copied to clipboard
open override fun onPlaced(coordinates: LayoutCoordinates)
Link copied to clipboard
open fun onRemeasured(size: IntSize)
Link copied to clipboard
open fun onReset()
Link copied to clipboard
fun sideEffect(effect: () -> Unit)