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: BlazeWidgetItemTextStyleisVisible
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
positionandmargins(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,
isVisiblehas 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:
| Property | Default |
|---|---|
| isVisible | false |
| topSpacing | 2.blazeDp |
| textSize | 11f |
| textColor | #BABABA |
| fontResId | null (system font) |
| maxLines | 1 |
| gravity | Gravity.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.GRAYUpdated 14 days ago
