Class NativeViewsFactory
-
- All Implemented Interfaces:
public class NativeViewsFactory
-
-
Method Summary
Modifier and Type Method Description static IconAdViewgetIconAdView(@NonNull() Context context)Creates View for icon element. static IconAdViewgetIconView(@NonNull() Context context)Creates View for icon element. static MediaAdViewgetMediaAdView(@NonNull() Context context)Creates MediaAdView to show picture, video or scrolling cards static NativeAdCardViewgetNativeAdCardView(@NonNull() Context context)Creates view for inner cards element. static NativeAdChoicesViewgetNativeAdChoicesView(@NonNull() Context context)Creates custom View to implement AdChoices in native ads. static NativeAdViewgetNativeAdView(@NonNull() Context context)Creates standard native view with MediaAdView. static NativeAdViewgetNativeAdViewWithExtendedCards(@NonNull() Context context)Creates standard native view with scrolling horizontally cards inside. static NativeAdViewgetNativeAdViewWithExtendedCards(float cardScaleFactor, int cardSpacing, @NonNull() Context context)Creates standard native view with scrolling horizontally cards inside. static NativeBannerAdViewgetNativeBannerAdView(@NonNull() Context context)Creates small Native Ads view. static PromoCardRecyclerViewgetPromoCardRecyclerView(@NonNull() Context context)Creates RecyclerView to use horizontal scrolling cards. static PromoCardRecyclerViewgetPromoCardRecyclerView(float cardScaleFactor, int cardSpacing, @NonNull() Context context)Creates RecyclerView to use horizontal scrolling cards. -
-
Method Detail
-
getIconAdView
@Deprecated()@NonNull() static IconAdView getIconAdView(@NonNull() Context context)
Creates View for icon element. IconAdView keeps dimensions of image inside and has no additional logic
- Parameters:
context- app context- Returns:
IconAdView
-
getIconView
@NonNull() static IconAdView getIconView(@NonNull() Context context)
Creates View for icon element. IconAdView keeps dimensions of image inside and has no additional logic
- Parameters:
context- app context- Returns:
IconAdView
-
getMediaAdView
@NonNull() static MediaAdView getMediaAdView(@NonNull() Context context)
Creates MediaAdView to show picture, video or scrolling cards
- Parameters:
context- app context- Returns:
MediaAdView
-
getNativeAdCardView
@NonNull() static NativeAdCardView getNativeAdCardView(@NonNull() Context context)
Creates view for inner cards element. Can be used with custom cards adapter
- Parameters:
context- app context- Returns:
card view
-
getNativeAdChoicesView
@NonNull() static NativeAdChoicesView getNativeAdChoicesView(@NonNull() Context context)
Creates custom View to implement AdChoices in native ads. If this view added to registered native view, it will be positioned instead of default AdChoices view.
- Parameters:
context- app context- Returns:
custom View for AdChoices
-
getNativeAdView
@NonNull() static NativeAdView getNativeAdView(@NonNull() Context context)
Creates standard native view with MediaAdView. NativeAdView uses MediaAdView to show video, picture or scrolling horizontally cards, contained picture only. If need to show more extended cards, use NativeViewsFactory.getNativeAdViewWithExtendedCards(Context)
- Parameters:
context- app context- Returns:
Native ads view
-
getNativeAdViewWithExtendedCards
@NonNull() static NativeAdView getNativeAdViewWithExtendedCards(@NonNull() Context context)
Creates standard native view with scrolling horizontally cards inside. Using banner with cards it is possible to create NativeAdView with NativeViewsFactory.getNativeAdView(Context), but current method provides more extended cards.
- Parameters:
context- app context- Returns:
Native ads view with cards
-
getNativeAdViewWithExtendedCards
@NonNull() static NativeAdView getNativeAdViewWithExtendedCards(float cardScaleFactor, int cardSpacing, @NonNull() Context context)
Creates standard native view with scrolling horizontally cards inside. Using banner with cards it is possible to create NativeAdView with NativeViewsFactory.getNativeAdView(Context), but current method provides more extended cards.
- Parameters:
cardScaleFactor- The drawing scale for the recyclerView item.cardSpacing- Width padding between recyclerView items.context- app context- Returns:
Native ads view with cards
-
getNativeBannerAdView
@NonNull() static NativeBannerAdView getNativeBannerAdView(@NonNull() Context context)
Creates small Native Ads view. Unlike NativeAdView it isn't contain MediaAdView and has smaller height
- Parameters:
context- app context- Returns:
NativeBannerAdView
-
getPromoCardRecyclerView
@NonNull() static PromoCardRecyclerView getPromoCardRecyclerView(@NonNull() Context context)
Creates RecyclerView to use horizontal scrolling cards. Can be used in custom native ads views if extended cards are needed
- Parameters:
context- app context- Returns:
PromoCardRecyclerView
-
getPromoCardRecyclerView
@NonNull() static PromoCardRecyclerView getPromoCardRecyclerView(float cardScaleFactor, int cardSpacing, @NonNull() Context context)
Creates RecyclerView to use horizontal scrolling cards. Can be used in custom native ads views if extended cards are needed
- Parameters:
cardScaleFactor- The drawing scale for the recyclerView item.cardSpacing- Width padding between recyclerView items.context- app context- Returns:
PromoCardRecyclerView
-
-
-
-