Class NativeViewsFactory
- java.lang.Object
-
- com.my.target.nativeads.factories.NativeViewsFactory
-
public class NativeViewsFactory extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description NativeViewsFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IconAdViewgetIconAdView(android.content.Context context)Creates View for icon element.static MediaAdViewgetMediaAdView(android.content.Context context)Creates MediaAdView to show picture, video or scrolling cardsstatic NativeAdCardViewgetNativeAdCardView(android.content.Context context)Creates view for inner cards element.static NativeAdChoicesViewgetNativeAdChoicesView(android.content.Context context)Creates custom View to implement AdChoices in native ads.static NativeAdViewgetNativeAdView(android.content.Context context)Creates standard native view with MediaAdView.static NativeAdViewgetNativeAdViewWithExtendedCards(float cardScaleFactor, int cardSpacing, android.content.Context context)Creates standard native view with scrolling horizontally cards inside.static NativeAdViewgetNativeAdViewWithExtendedCards(android.content.Context context)Creates standard native view with scrolling horizontally cards inside.static NativeBannerAdViewgetNativeBannerAdView(android.content.Context context)Creates small Native Ads view.static PromoCardRecyclerViewgetPromoCardRecyclerView(float cardScaleFactor, int cardSpacing, android.content.Context context)Creates RecyclerView to use horizontal scrolling cards.static PromoCardRecyclerViewgetPromoCardRecyclerView(android.content.Context context)Creates RecyclerView to use horizontal scrolling cards.
-
-
-
Method Detail
-
getNativeAdCardView
@NonNull public static NativeAdCardView getNativeAdCardView(@NonNull android.content.Context context)
Creates view for inner cards element. Can be used with custom cards adapter- Parameters:
context- app context- Returns:
- card view
- See Also:
PromoCardRecyclerView.PromoCardAdapter
-
getNativeAdView
@NonNull public static NativeAdView getNativeAdView(@NonNull android.content.Context context)
Creates standard native view with MediaAdView.NativeAdViewuses MediaAdView to show video, picture or scrolling horizontally cards, contained picture only. If need to show more extended cards, usegetNativeAdViewWithExtendedCards(Context)- Parameters:
context- app context- Returns:
- Native ads view
- See Also:
NativeAdView
-
getNativeAdViewWithExtendedCards
@NonNull public static NativeAdView getNativeAdViewWithExtendedCards(float cardScaleFactor, int cardSpacing, @NonNull android.content.Context context)
Creates standard native view with scrolling horizontally cards inside. Using banner with cards it is possible to create NativeAdView withgetNativeAdView(Context), but current method provides more extended cards.- Parameters:
cardScaleFactor- The drawing scale for the recyclerView item. 1f=100%cardSpacing- Width padding between recyclerView items. Specified in dip.context- app context- Returns:
- Native ads view with cards
- See Also:
NativeAdView
-
getNativeAdViewWithExtendedCards
@NonNull public static NativeAdView getNativeAdViewWithExtendedCards(@NonNull android.content.Context context)
Creates standard native view with scrolling horizontally cards inside. Using banner with cards it is possible to create NativeAdView withgetNativeAdView(Context), but current method provides more extended cards.- Parameters:
context- app context- Returns:
- Native ads view with cards
- See Also:
NativeAdView
-
getMediaAdView
@NonNull public static MediaAdView getMediaAdView(@NonNull android.content.Context context)
Creates MediaAdView to show picture, video or scrolling cards- Parameters:
context- app context- Returns:
- MediaAdView
- See Also:
MediaAdView
-
getNativeBannerAdView
@NonNull public static NativeBannerAdView getNativeBannerAdView(@NonNull android.content.Context context)
Creates small Native Ads view. UnlikeNativeAdViewit isn't contain MediaAdView and has smaller height- Parameters:
context- app context- Returns:
- NativeBannerAdView
- See Also:
NativeBannerAdView
-
getPromoCardRecyclerView
@NonNull public static PromoCardRecyclerView getPromoCardRecyclerView(@NonNull android.content.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
- See Also:
PromoCardRecyclerView
-
getPromoCardRecyclerView
@NonNull public static PromoCardRecyclerView getPromoCardRecyclerView(float cardScaleFactor, int cardSpacing, @NonNull android.content.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. 1f=100%cardSpacing- Width padding between recyclerView items. Specified in dip.context- app context- Returns:
- PromoCardRecyclerView
- See Also:
PromoCardRecyclerView
-
getIconAdView
@NonNull public static IconAdView getIconAdView(@NonNull android.content.Context context)
Creates View for icon element. IconAdView keeps dimensions of image inside and has no additional logic- Parameters:
context- app context- Returns:
- IconAdView
- See Also:
IconAdView
-
getNativeAdChoicesView
@NonNull public static NativeAdChoicesView getNativeAdChoicesView(@NonNull android.content.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
- See Also:
NativeAdChoicesView
-
-