KeylineState

public final class KeylineState


An arrangement of keylines that are positioned along a scrolling axis.

This class is the model used to tell a scrolling item how it should be masked, offset, or treated at certain points (keylines) along the scrolling axis.

Keylines are points located along a scrolling axis, relative to the scrolling container's bounds, that tell an item how it should be treated (masked, offset) when it's center is located at a keyline. When between keylines, a scrolling item is treated by interpolating between the states of its nearest surrounding keylines. When put together, a KeylineState contains all keylines associated with a scrolling container and is able to tell a scrolling item how it should be treated at any point (as the item moves) along the scrolling axis, creating a fluid interpolated motion tied to scroll position.

Keylines can be either focal or non-focal. A focal keyline is a keyline where items are considered visible or interactable in their fullest form. This usually means where items will be fully unmaksed and viewable. There must be at least one focal keyline in a KeylineState. The focal keylines are important for usability and alignment. Start-aligned strategies should place focal keylines at the beginning of the scroll container, center-aligned strategies at the center of the scroll container, etc.

Summary

Nested types

public final class KeylineState.Builder

A builder used to construct a KeylineState.