GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeWidgetItemBadgeStyle - Android

The BlazeWidgetItemBadgeStyle class represents the configuration for the badge of a widget item.

Content can also carry its own badge image, set per Story, Moment, or Video in the CMS. That image replaces the background image in every state and shows the badge even when it's hidden here. It fills the badge, so padding doesn't apply to it. The rest of this style still applies. The badge appears once the image has loaded. If the image fails to load, the badge stays hidden for that item.

Defaults in the presets

  • Circle presets: the badge sits at the top end of the image, with no margins.
  • Rectangle presets (vertical and horizontal): the badge sits at the top center of the image, 4dp below the top edge.
  • Padding: 4dp on every side.
  • Text: 8sp in the dark primary color. This also applies to badge state styles created with unread(), read(), liveUnread(), or liveRead() that set text without a textStyle.

Change any of these on the widget's BlazeWidgetItemStyle.badge.

Properties

position

var position: BlazeObjectPositioning

The position of the badge Relative To The Image within the widget item.

isVisible

var isVisible: Boolean

A Boolean value that determines whether the badge is visible.

📘

Content with its own badge image from the CMS shows the badge regardless of this value.

margins

var margins: BlazeInsets

A BlazeInsets value that defines the margins for the badge related to the widget item container.

padding

var padding: BlazeInsets

A BlazeInsets value that defines the padding for the badge related to the widget item container.

📘

Content with its own badge image from the CMS fills the badge regardless of this value.

liveUnreadState

var liveUnreadState: BlazeWidgetItemBadgeStateStyle

The style configuration for the live unread badge.

liveReadState

var liveReadState: BlazeWidgetItemBadgeStateStyle

The style configuration for the live read badge.

unreadState

var unreadState: BlazeWidgetItemBadgeStateStyle

The style configuration for the unread badge.

readState

var readState: BlazeWidgetItemBadgeStateStyle

The style configuration for the read badge.


width

var width: BlazeDp

The width of the badge.

height

var height: BlazeDp

The height of the badge.


Did this page help you?