blur
Blurs away, or wipes the new theme in out of focus.
The full recording — the example app on an Android
emulator and an iOS simulator at once, with blur played several times
over. Scrub or pause with the controls.
Two quite different animations behind one kind, chosen with blurStyle. uniform blurs the whole screen at once and lets it recede. sweep is a wipe that brings the new theme in out of focus and pulls it sharp as it arrives — the outgoing copy is never blurred at all, it is simply taken away by the mask.
Options it takes
| Option | Type | Default | What it does here |
|---|---|---|---|
blurStyle |
'uniform' | 'sweep' |
'uniform' |
How the blur applies itself.
|
direction |
'top' | 'bottom' | 'left' | 'right' |
'bottom' |
The edge the sweep travels through. Only read when blurStyle is sweep; ignored under uniform.
|
angleDeg |
number |
0 |
Tilt of the sweep’s boundary line, exactly as slide takes it. Only read when blurStyle is sweep. |
durationMs |
number |
650 |
Animation length. Clamped up to this kind’s floor; 0 means no animation and is never clamped. |
settleFrames |
number |
2 |
Display frames to hold the snapshot before revealing, so the theme swap has painted underneath. |
Ignored by this kind: origin, shape, bands. Passing them is harmless.
Minimum duration
A request below 300ms is clamped up to it, natively, so both
platforms agree. Below that floor a full-screen copy coming apart has too few frames to
read as motion — the eye gets the start and the end and nothing in between, which looks
like a flicker rather than a fast transition. durationMs: 0 still means “no
animation” and is never clamped.
Usage
withThemeTransition(applyTheme, {
kind: 'blur',
durationMs: 650,
blurStyle: 'sweep',
direction: 'bottom',
angleDeg: 0,
});
How it is done
| iOS | UIVisualEffectView + property animator |
|---|---|
| Android | RenderEffect.createBlurEffect |