GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeWidgetItemSubtitleStyle - Android

The BlazeWidgetItemSubtitleStyle class defines the subtitle 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 subtitle from its metadata.

Properties

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

isVisible

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

topSpacing

The spacing above the subtitle, separating it from the title. Only applies below a visible line. If the title is hidden, the subtitle starts at the top of the block.

unreadState

The subtitle text style for unread items.

readState

The subtitle 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 subtitle has no position or horizontal margins of its own.
  • A visible subtitle with no text for an item takes no space, and the description moves up.
  • Only Moments widgets show a subtitle. 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.subtitle.isVisible = true
layout.widgetItemStyle.subtitle.topSpacing = 4.blazeDp
layout.widgetItemStyle.subtitle.unreadState.textColor = Color.LTGRAY
layout.widgetItemStyle.subtitle.readState.textColor = Color.GRAY

Did this page help you?