NativeAdStyle
Per-screen look for a native ad.
A native ad only works when it looks like it belongs on the screen it is on, and screens differ: one draws its icons in a circle, the next cuts them from a Material shape, one uses filled buttons, the next uses text buttons. A style says how this one placement should look, without the host having to build a view tree of its own.
It overrides only what it names. Every value has a default that means "leave it as the presentation built it", so a style that sets one property changes one property. That also makes styles safe to combine with a custom NativeAdViewFactory: the factory decides the arrangement, the style decides the finish.
It is applied in the same pass as NativeAdPalette, on views that already exist, so changing a style repaints the ad rather than rebuilding it. Rebuilding would discard the loaded ad.
Constructors
Properties
Badge fill. Color.Unspecified keeps the palette's neutral surface, which is right for a card that sits on its own and wrong on a screen whose icons are all primaryContainer.
Corner radius of the badge when there is no badgeShape. null keeps the shared radius.
Silhouette the icon badge is filled with, from rememberNativeAdBadgeShape. null keeps the rounded square at badgeCornerRadiusDp.
Body color. Color.Unspecified keeps the palette's onSurfaceVariant.
Body line cap. null keeps the presentation's own. Lower it when a long description would make the ad taller than the rows beside it.
Body size. null keeps the presentation's own.
Whether the call to action is a filled pill or a text button.
Whether the headline is bold. null keeps the presentation's own. A headline heavier than the titles around it reads as an intruder.
Headline color. Color.Unspecified keeps the palette's onSurface.
Headline size. null keeps the presentation's own.
Padding inside the icon badge. A non-null value centres the full advertiser icon without cropping it, leaving the badge shape visible. null keeps the presentation's inset.