CommandButtonLayoutManager

interface CommandButtonLayoutManager : MeasureScope

Definition of a layout manager for command buttons.

Author

Kirill Grouchnikov

Types

Link copied to clipboard
data class CommandButtonLayoutInfo(fullSize: Size, actionClickArea: Rect, popupClickArea: Rect, separatorArea: Rect, iconRect: Rect, textLayoutInfoList: List<CommandButtonLayoutManager.TextLayoutInfo>, extraTextLayoutInfoList: List<CommandButtonLayoutManager.TextLayoutInfo>, popupActionRect: Rect)

Layout information on different visual parts of a single command button.

Link copied to clipboard
data class CommandButtonPreLayoutInfo(commandButtonKind: CommandButtonKind, showIcon: Boolean, texts: List<String>, extraTexts: List<String>, isTextInActionArea: Boolean, separatorOrientation: CommandButtonLayoutManager.CommandButtonSeparatorOrientation?, showPopupIcon: Boolean)

Pre-layout information on different visual parts of a single command button.

Link copied to clipboard

Enumerates the available values for separator orientations.

Link copied to clipboard
data class TextLayoutInfo(text: String, textRect: Rect)

Layout information on a single line of text.

Functions

Link copied to clipboard
abstract fun getLayoutInfo(constraints: Constraints, command: Command, presentationModel: CommandButtonPresentationModel, preLayoutInfo: CommandButtonLayoutManager.CommandButtonPreLayoutInfo): CommandButtonLayoutManager.CommandButtonLayoutInfo

Returns the layout information for the specified parameters.

Link copied to clipboard
abstract fun getPreferredIconSize(command: Command, presentationModel: CommandButtonPresentationModel): Dp

Returns the preferred icon size under this layout manager. Note that some layout managers may use fixed icon size, while some may respect the icon size set in .presentationModel

Link copied to clipboard
abstract fun getPreferredSize(command: Command, presentationModel: CommandButtonPresentationModel, preLayoutInfo: CommandButtonLayoutManager.CommandButtonPreLayoutInfo): Size

Returns the preferred size of a projected button for the specified parameters.

Link copied to clipboard
abstract fun getPreLayoutInfo(command: Command, presentationModel: CommandButtonPresentationModel): CommandButtonLayoutManager.CommandButtonPreLayoutInfo

Returns the pre-layout information for the specified parameters.

Link copied to clipboard
open fun layout(width: Int, height: Int, alignmentLines: Map<AlignmentLine, Int>, placementBlock: Placeable.PlacementScope.() -> Unit): MeasureResult
Link copied to clipboard
open fun Dp.roundToPx(): Int
open fun TextUnit.roundToPx(): Int
Link copied to clipboard
open fun TextUnit.toDp(): Dp
open fun Float.toDp(): Dp
open fun Int.toDp(): Dp
Link copied to clipboard
open fun Size.toDpSize(): DpSize
Link copied to clipboard
open fun Dp.toPx(): Float
open fun TextUnit.toPx(): Float
Link copied to clipboard
open fun DpRect.toRect(): Rect
Link copied to clipboard
open fun DpSize.toSize(): Size
Link copied to clipboard
open fun Dp.toSp(): TextUnit
open fun Float.toSp(): TextUnit
open fun Int.toSp(): TextUnit

Properties

Link copied to clipboard
abstract val density: Float
Link copied to clipboard
abstract val fontScale: Float
Link copied to clipboard
abstract val layoutDirection: LayoutDirection