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(), orliveRead()that settextwithout atextStyle.
Change any of these on the widget's BlazeWidgetItemStyle.badge.
Properties
position
var position: BlazeObjectPositioningThe position of the badge Relative To The Image within the widget item.
isVisible
var isVisible: BooleanA 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: BlazeInsetsA BlazeInsets value that defines the margins for the badge related to the widget item container.
padding
var padding: BlazeInsetsA 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: BlazeWidgetItemBadgeStateStyleThe style configuration for the live unread badge.
liveReadState
var liveReadState: BlazeWidgetItemBadgeStateStyleThe style configuration for the live read badge.
unreadState
var unreadState: BlazeWidgetItemBadgeStateStyleThe style configuration for the unread badge.
readState
var readState: BlazeWidgetItemBadgeStateStyleThe style configuration for the read badge.
width
var width: BlazeDpThe width of the badge.
height
var height: BlazeDpThe height of the badge.
Updated about 9 hours ago
