NativeAdBadgeShape

class NativeAdBadgeShape(val path: Path, val sizePx: Float)(source)

A Compose Shape, flattened to the path an ad's icon badge is filled with.

An ad's assets have to be rendered inside a real NativeAdView, so the badge behind the icon is an Android view and cannot be given a Compose Shape directly. It can, however, be filled with the path that shape describes, which is what this carries: any silhouette a caller can express in Compose, MaterialShapes included, reaches the ad badge, drawn antialiased by the same PathShape machinery the platform uses for its own shape drawables.

Constructors

Link copied to clipboard
constructor(path: Path, sizePx: Float)

Properties

Link copied to clipboard
val path: Path

The outline, in pixels, at sizePx.

Link copied to clipboard

The square size the path was measured at. The drawable rescales from it, so a badge that ends up a pixel larger or smaller than the measurement still fills exactly.