KVADRANT UI api reference demo

kvadrantTilt

foundation

press and hold: the plane leans towards the finger and follows it

dark
light

mounted as tilt

why it looks like this

A press that keeps leaning towards the finger as it moves, the way the original did.

TiltEffect.cs calls ApplyTiltEffect from three handlers, not one — pressed, moved, and the timer — so a press that starts in the middle of a tile and slides to its corner ends up at the corner's full lean. TiltIndication cannot do this and the reason is structural rather than an oversight: it reads an InteractionSource, and that source carries Press, Release and Cancel and no motion at all. The position arrives once and there is no later event to update it from.

Measured before it was built, because the item asked for that. On a 158 px tile the leading column of the drawn quad is 152 px for a centre press and 119 for a corner one — a fifth of the edge — so a finger dragged across a tile leaves a quarter of the effect on the table.

This is canon, not an improvement, so it is not behind remastered.

It cannot be built on clickable, and that was tried first. Wrapping it — an observer that watches the pointer and re-emits clickable's own press at the new position — is tidier in every way except the one that matters: clickable gives the gesture up at the touch slop, so the press it is mirroring is cancelled by the very movement this exists to follow. Measured, not reasoned: the wrapped version put a press dragged to the corner further from a corner press than from a centre one, because by then there was no press at all.

So the gesture is this modifier's own, and the price is paid explicitly. A change somebody else has consumed ends the press, which is how a list scrolls out from under a finger that started on a tile — without that line the list scrolls and the tile stays leaning, which is a defect the scroll test would not have caught because the list did move.

This used to end by saying keyboard activation and focus were still clickable's job and that a surface needing them should keep clickable. That was a sentence, not a plan: the only surface in the library that uses this modifier is the tile, the tile is the component the library is for, and telling it to use something else means telling it to give up the finger-tracking this exists for. B-40. So the two are reimplemented below — Modifier.focusable over the same interaction source, and a key handler that presses on the way down and clicks on the way up, which is what AbstractClickableNode does. Reusing the source is the whole trick: the focus ring lives in the indication, so it arrives with no further wiring.

A press is this modifier's vocabulary because it is the indication's: a bespoke Interaction would mean every component in the library remembering to emit it, which is the forgotten-call-site failure the indication design exists to avoid.

Read it: kvadrant-core/src/commonMain/kotlin/io/github/youndie/kvadrant/indication/KvadrantTiltModifier.kt · the full signature and every parameter