Package-level declarations

Types

Link copied to clipboard
class KvadrantOverscroll(scope: CoroutineScope, maxOffset: Float = DEFAULT_MAX_OFFSET, resistance: Float = DEFAULT_RESISTANCE, flingReference: Float = DEFAULT_FLING_REFERENCE) : OverscrollEffect

The end of a list, the way Windows Phone ended one: the content follows the finger past the boundary, showing the page behind it, and rubber-bands back when it lets go.

Link copied to clipboard
class KvadrantOverscrollFactory(scope: CoroutineScope, maxOffset: Float = KvadrantOverscroll.DEFAULT_MAX_OFFSET, resistance: Float = KvadrantOverscroll.DEFAULT_RESISTANCE, flingReference: Float = KvadrantOverscroll.DEFAULT_FLING_REFERENCE) : OverscrollFactory

Hands KvadrantTheme an effect per scrolling surface, the way an indication is handed out.

Link copied to clipboard
object Tilt

The tilt geometry of Windows Phone, transcribed from TiltEffect.cs (the RTM algorithm, "direct from the shell team"): a press rotates the plane towards the finger and pushes it away from the viewer, by an amount that trades off against the rotation.

Link copied to clipboard
class TiltIndication(cameraDistance: Dp = DEFAULT_CAMERA_DISTANCE, maxDepression: Dp = Tilt.maxDepression, animatePress: Boolean = false, focusRingThickness: Dp = KvadrantMetrics().focusRingThickness, sharedCamera: Boolean = false) : IndicationNodeFactory

Metro's press feedback, in the slot Material fills with a ripple — and, since B-40, the keyboard focus ring that goes in the same slot.

Link copied to clipboard
data class TiltTransform(val rotationX: Float, val rotationY: Float, val depression: Dp)

Where the plane ends up for a press at position on a surface of size.

Functions

Link copied to clipboard
fun Modifier.kvadrantTilt(enabled: Boolean = true, interactionSource: MutableInteractionSource? = null, onClick: () -> Unit): Modifier

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

Link copied to clipboard
fun tiltFor(position: Offset, size: Size, maxDepression: Dp = Tilt.maxDepression): TiltTransform
Link copied to clipboard
fun tiltReturn(millisSinceRelease: Long): Float

How much of the tilt is still applied, millisSinceRelease after the finger left.