TableChildren

class TableChildren
kotlin.Any
   ↳ androidx.ui.layout.TableChildren

Collects information about the children of a Table when its body is executed with a TableChildren as argument.

Summary

Public methods

Unit
tableDecoration(overlay: Boolean, decoration: TableDecoration)

Adds a decoration which will be placed either above or below the content of the Table.

Unit
tableRow(children: () -> Unit)

Creates a new row in the Table with the specified content.

Extension functions

From androidx.ui.foundation
Unit
TableChildren.drawBorders(defaultBorder: Border = Border(color = Color.Black, width = Dp.Hairline), block: DrawBordersReceiver.() -> Unit)

Adds border drawing for a Table layout, when placed inside the TableChildren block.

Public methods

tableDecoration

fun tableDecoration(
    overlay: Boolean,
    decoration: TableDecoration
): Unit

Adds a decoration which will be placed either above or below the content of the Table. This can be either a component, such as Layout or SizedRectangle, or a Draw composable. Note that decorations are measured with tight constraints to fill the size of the Table, and the offsets of each row and column of the Table are available inside the body of this.

Example usage:

import androidx.ui.foundation.shape.DrawShape
import androidx.ui.layout.Padding
import androidx.ui.layout.Table

Padding(2.dp) {
    Table(columns = 8) {
        tableDecoration(overlay = false) {
            SizedRectangle(color = Color.Green)
        }
        tableDecoration(overlay = false) {
            DrawShape(shape = CircleShape, color = Color.Red)
        }
        for (i in 0 until 8) {
            tableRow {
                for (j in 0 until 8) {
                    Padding(2.dp) {
                        SizedSquare(color = Color.Magenta)
                    }
                }
            }
        }
    }
}
Parameters
overlay: Boolean Whether the decoration is placed above (true) or below (false) the content.

tableRow

fun tableRow(children: () -> Unit): Unit

Creates a new row in the Table with the specified content.