EdgeContentLayout.Builder


class EdgeContentLayout.Builder


Builder class for EdgeContentLayout.

Summary

Public constructors

Creates a builder for the EdgeContentLayout.

Public functions

EdgeContentLayout

Constructs and returns EdgeContentLayout with the provided content and look.

EdgeContentLayout.Builder

Sets the additional content to this layout, inside of the screen.

EdgeContentLayout.Builder

Sets the space size between the additional content and secondary label if there is any.

EdgeContentLayout.Builder

Sets the content to be around the edges.

EdgeContentLayout.Builder

Sets whether the edge content passed in with setEdgeContent should be positioned behind all other content in this layout or above it.

EdgeContentLayout.Builder
setEdgeContentThickness(thickness: @Dimension(unit = 0) Float)

Sets the thickness of the hollow edge content so that other content is correctly placed.

EdgeContentLayout.Builder

Sets the content in the primary label slot.

EdgeContentLayout.Builder

Changes this EdgeContentLayout to better follow guidelines for type of layout that has content around the edge.

EdgeContentLayout.Builder

Sets the content in the secondary label slot which will be below the additional content.

Public constructors

Builder

Added in 1.0.0
Builder(deviceParameters: DeviceParametersBuilders.DeviceParameters)

Creates a builder for the EdgeContentLayout. Custom content inside of it can later be set with (setContent.

For optimal layouts across different screen sizes and better alignment with UX guidelines, it is highly recommended to call setResponsiveContentInsetEnabled.

Public functions

build

Added in 1.0.0
fun build(): EdgeContentLayout

Constructs and returns EdgeContentLayout with the provided content and look.

setContent

Added in 1.0.0
fun setContent(content: LayoutElementBuilders.LayoutElement): EdgeContentLayout.Builder

Sets the additional content to this layout, inside of the screen.

setContentAndSecondaryLabelSpacing

Added in 1.2.0
fun setContentAndSecondaryLabelSpacing(height: DimensionBuilders.DpProp): EdgeContentLayout.Builder

Sets the space size between the additional content and secondary label if there is any. If one of those is not present, spacer is not used. If not set, DEFAULT_VERTICAL_SPACER_HEIGHT will be used.

Note that, this method should be used together with setResponsiveContentInsetEnabled, otherwise it will be ignored.

setEdgeContent

Added in 1.0.0
fun setEdgeContent(edgeContent: LayoutElementBuilders.LayoutElement): EdgeContentLayout.Builder

Sets the content to be around the edges. This can be CircularProgressIndicator.

If this content is something other that CircularProgressIndicator, please add its thickness with setEdgeContentThickness for best results.

setEdgeContentBehindAllOtherContent

Added in 1.1.0
fun setEdgeContentBehindAllOtherContent(isBehind: Boolean): EdgeContentLayout.Builder

Sets whether the edge content passed in with setEdgeContent should be positioned behind all other content in this layout or above it. If not set, defaults to false, meaning that the edge content will be placed above all other content.

Note that, if setResponsiveContentInsetEnabled is set to true, edge content will always go behind all other content and this method call will throw as those shouldn't be mixed.

setEdgeContentThickness

Added in 1.2.0
fun setEdgeContentThickness(thickness: @Dimension(unit = 0) Float): EdgeContentLayout.Builder

Sets the thickness of the hollow edge content so that other content is correctly placed. In other words, sets the space that should be reserved exclusively for the edge content and not be overdrawn by other inner content.

For example, for CircularProgressIndicator or elements, this should be equal to their stroke width/thickness.

Note that, calling this method when responsiveness is not set with setResponsiveContentInsetEnabled, will be ignored.

setPrimaryLabelTextContent

Added in 1.0.0
fun setPrimaryLabelTextContent(
    primaryLabelText: LayoutElementBuilders.LayoutElement
): EdgeContentLayout.Builder

Sets the content in the primary label slot.

Depending on whether setResponsiveContentInsetEnabled is set to true or not, this label will be placed as following: - If responsive behaviour is set, label will be above the additional content, on a fixed place to ensure Tiles consistency with other layouts. Additionally, the label will also have an inset to prevent it from going off the screen. - If responsive behaviour is not set or called, label will be above the additional content, centered in the remaining space.

setResponsiveContentInsetEnabled

Added in 1.2.0
fun setResponsiveContentInsetEnabled(enabled: Boolean): EdgeContentLayout.Builder

Changes this EdgeContentLayout to better follow guidelines for type of layout that has content around the edge.

These updates include: 1. Using responsive insets for its content primary and secondary label by adding some additional space on the sides of these elements to avoid content going off the screen edge. 2. Changing layout padding to responsive to better follow different screen sizes. 3. Positioning primary label at a fixed place on top of the screen rather than following additional content.

It is highly recommended to call this method with true when using this layout to optimize it for different screen sizes.

setSecondaryLabelTextContent

Added in 1.0.0
fun setSecondaryLabelTextContent(
    secondaryLabelText: LayoutElementBuilders.LayoutElement
): EdgeContentLayout.Builder

Sets the content in the secondary label slot which will be below the additional content. It is highly recommended to have primary label set when having secondary label.

Note that when setResponsiveContentInsetEnabled is set to true, the label will also have an inset to prevent it from going off the screen.