GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeWidgetItemImageStyle - Android

The BlazeWidgetItemImageStyle class is responsible for defining the style and layout of the image within a widget item. It includes properties for positioning, size, thumbnail type, and border customization.

Properties

position: BlazeImagePosition,
width: BlazeDp?,
height: BlazeDp?,
ratio: Float?,
border: BlazeWidgetItemImageContainerBorderStyle,
thumbnailType: BlazeThumbnailType?,
cornerRadius: BlazeDp,
cornerRadiusRatio: Float?,
margins: BlazeInsets,
gradientOverlay: BlazeWidgetItemImageGradientOverlayStyle,
animatedThumbnail: BlazeWidgetItemImageAnimatedThumbnailStyle

position

var position: BlazeImagePosition

The position of the image within the widget item.

width

var width: BlazeDp?

The width of the image.

height

var height: BlazeDp?

The height of the image.

ratio

var ratio: Float?

The aspect ratio of the image.

border

var position: BlazeWidgetItemImageContainerBorderStyle

The border style of the image container.

thumbnailType

var thumbnailType: BlazeThumbnailType?

The type of the thumbnail for the image.

cornerRadius

var cornerRadius: BlazeDp

The corner radius of the image.

cornerRadiusRatio

var cornerRadiusRatio: Float?

The corner radius ratio is a value between 0.0 and 1.0, which computes the final corner radius for the image. Overrides the corner radius property. For example, a value of 0.5 on a 1:1 width/height image will result in a perfect circle style for the image.

margins

 margins: BlazeInsets

The margins of the image.

gradientOverlay

var gradientOverlay: BlazeWidgetItemImageGradientOverlayStyle

The gradient overlay style of the image.

animatedThumbnail

var animatedThumbnail: BlazeWidgetItemImageAnimatedThumbnailStyle

An object defining Animated Thumbnail behavior.

If used, please see the BlazeWidgetLayout.Presets.MomentsWidget.Row.verticalAnimatedThumbnailsRectangles preset.

Note animatedThumbnail is applicable only to Moments Row widgets. Any usage on any other scope will result in a no-op.

BlazeImagePosition Enum

The Position enum provides predefined positions for the image within the widget item:

ValueDescription
TopStartThe image is positioned at the top start corner.
TopCenterThe image is positioned at the top center.
TopEndThe image is positioned at the top end corner.
CenterStartThe image is positioned at the center start edge.
CenterThe image is positioned at the center.
CenterEndThe image is positioned at the center end edge.
BottomStartThe image is positioned at the bottom start corner.
BottomCenterThe image is positioned at the bottom center.
BottomEndThe image is positioned at the bottom end corner.

ThumbnailModelType Enum

The ThumbnailModelType enum defines the type of the image thumbnail:

ValueDescription
SQUARE_ICONUse the 1:1 thumbnail image defined as the thumbnail
VERTICAL_TWO_BY_THREEUse the 2:3 thumbnail image defined as the thumbnail
CUSTOMUse the main thumbnail image defined as a custom thumbnail

Did this page help you?