Ad Support (Android)

Ad Label Customisations

    <com.firework.videofeed.FwVideoFeedView
        android:id="@+id/videoFeedView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:fw_adBadgeBackgroundColor="#FFFECD"
        app:fw_adBadgeIsHidden="false"
        app:fw_adBadgeLabel="sponsored"
        app:fw_adBadgeShowOnThumbnails="true"
        app:fw_adBadgeTextColor="#000000"
        app:fw_adBadgeIsHidden="true"
        app:fw_adBadgeTextTypeface="@font/roboto"
        app:fw_feedResource="discovery"
        />
val typeface = Typeface.BOLD //Your custom typeface (font)

val layoutOption = LayoutOption.Builder()
    .feedLayout(FeedLayout.GRID)
    .columnCount(3)
    .build()

val baseOption = BaseOption.Builder()
    .feedResource(FeedResource.Discovery) // It also can be Channel and Playlist.
    .build()
    
val adOption = AdOption.Builder()
    .adsFetchTimeoutInSeconds(10) // This is used for loading retail media network ads in the feed.
    .vastAttributes(
        mapOf(
            "age" to "34",
            "category" to "food",
        ),
    )
    .build()

val adBadgeOption = AdBadgeOption.Builder()
    .adBadgeBackColor(Color.CYAN)
    .adBadgeIsHidden(false)
    .adBadgeLabel(AdBadgeTextType.SPONSORED)
    .adBadgeShowOnThumbnails(true)
    .adBadgeTextColor(Color.WHITE)
    .adBadgeTypeface(typeface)
    .build()
    
val viewOptions = ViewOptions.Builder()
    .layoutOption(layoutOption)
    .baseOption(baseOption)
    .adBadgeOption(adBadgeOption)
    .adOption(adOption)
    .build()

Last updated