TileLayout

class TileLayout(orientation: Orientation, spacing: Double) : Layout

A layout that tiles contents into squares that fit within the given area.

Parameters

orientation

direction the tiling follows

spacing

between tiles

Constructors

Link copied to clipboard
constructor(spacing: Double = 0.0)

Creates a TileLayout with Horizontal orientation.

constructor(orientation: Orientation, spacing: Double)

Functions

Link copied to clipboard
open override fun layout(views: Sequence<Positionable>, min: Size, current: Size, max: Size, insets: Insets): Size

Positions and sizes the given views and returns a size appropriate to laying out these views within the given constraints.

Inherited functions

Link copied to clipboard

Gets the child within the Positionable at the given point. The default is to ignore these calls and let the caller perform their own search for the right child. But Layouts are free to return a value here if it can be done more efficiently.

Link copied to clipboard
open fun preferredSize(views: Sequence<Positionable>, min: Size, current: Size, max: Size, insets: Insets = None): Size

Determines the best size to contain the views given the constraints. The default implementation relies on layout with current = max for the answer.

Link copied to clipboard
open fun requiresLayout(old: Size, new: Size): Boolean

Indicates whether a layout is needed because of the given size change to a container. This is called whenever the container's size changes.

open fun requiresLayout(child: Positionable, within: Size, old: Rectangle, new: Rectangle): Boolean

Indicates whether a layout is needed because of the given bounds change to a child within a container. This is called whenever the child's size changes.