GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeWidgetItemDescriptionStyle - Android

The BlazeWidgetItemDescriptionStyle class defines the description line of a Moments widget item: whether it shows, the spacing above it, and its text styles for the unread and read states. The line shows the moment's description from its metadata.

Properties

isVisible: Boolean,
topSpacing: BlazeDp,
unreadState: BlazeWidgetItemTextStyle,
readState: BlazeWidgetItemTextStyle

isVisible

Indicates whether the description is visible. Defaults to false on all presets.

topSpacing

The spacing above the description, separating it from the line above it (the subtitle, or the title when the subtitle is hidden). Only applies below a visible line. If neither the title nor the subtitle is shown, the description starts at the top of the block.

unreadState

The description text style for unread items.

readState

The description text style for read items.

How it's laid out

  • The title, subtitle, and description form one text block, always in that order. The block is placed with the title's position and margins (see BlazeWidgetItemTitleStyle), even when the title itself is hidden. The description has no position or horizontal margins of its own.
  • A visible description with no text for an item takes no space.
  • Only Moments widgets show a description. On Stories and Videos widgets, isVisible has no effect.
  • Basic formatting in the text, such as bold and italic, is kept. Links are shown as plain text.

Default values

The Moments presets use these values for both unreadState and readState:

PropertyDefault
isVisiblefalse
topSpacing2.blazeDp
textSize11f
textColor#BABABA
fontResIdnull (system font)
maxLines1
gravityGravity.START

Example

val layout = BlazeWidgetLayout.Presets.MomentsWidget.Row.verticalRectangles

layout.widgetItemStyle.description.isVisible = true
layout.widgetItemStyle.description.topSpacing = 4.blazeDp
layout.widgetItemStyle.description.unreadState.textColor = Color.LTGRAY
layout.widgetItemStyle.description.readState.textColor = Color.GRAY

Did this page help you?