Android SDK Version
  • java.lang.Object
    • FrameLayout
      • com.facebook.ads.internal.api.AdComponentView
        • com.facebook.ads.NativeAdLayout

public class NativeAdLayout
extends com.facebook.ads.internal.api.AdComponentView
NativeAdLayout is a wrapper for FrameLayout that is required to show the inline ad reporting menu for Native Ads. Inline ad reporting makes it easier for users to report bad ads so that the overall experience can be improved.
To create an Ad using this wrapper, create a NativeAdLayout and add your current ad layout as the root element. Since NativeAdLayout is simply a FrameLayout, you can add your current layout as is.
Then, when creating the AdOptionsView, make sure to pass the NativeAdLayout in the constructor.
When rendering the ad, you can check that everything is working properly by clicking on the Ad Choices button. If the NativeAdLayout was passed, we will render an overlay on top of the ad with the reporting options. Otherwise, or if the ad is too small, it will open a website.
Since:
5.1
Constructor Summary
Constructor and Description
NativeAdLayout(Context context) 
NativeAdLayout(Context context, AttributeSet attrs) 
NativeAdLayout(Context context, AttributeSet attrs, int defStyleAttr) 
NativeAdLayout(Context context, com.facebook.ads.internal.api.NativeAdLayoutApi nativeAdLayoutApi)
Used by other SDK classes and subject to change.
Method Summary
Modifier and TypeMethod and Description
com.facebook.ads.internal.api.NativeAdLayoutApigetNativeAdLayoutApi()
Used by other SDK classes and subject to change.
voidsetMaxWidth(int maxWidth) 
voidsetMinWidth(int minWidth) 
Methods inherited from class com.facebook.ads.internal.api.AdComponentView
attachAdComponentViewApi, onAttachedToWindow, onDetachedFromWindow, onMeasure, onVisibilityChanged, onWindowFocusChanged, setLayoutParams
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail

NativeAdLayout

public NativeAdLayout(Context context)

NativeAdLayout

public NativeAdLayout(Context context,
                      AttributeSet attrs)

NativeAdLayout

public NativeAdLayout(Context context,
                      AttributeSet attrs,
                      int defStyleAttr)

NativeAdLayout

public NativeAdLayout(Context context,
                      com.facebook.ads.internal.api.NativeAdLayoutApi nativeAdLayoutApi)
Used by other SDK classes and subject to change.
Method Detail

getNativeAdLayoutApi

public com.facebook.ads.internal.api.NativeAdLayoutApi getNativeAdLayoutApi()
Used by other SDK classes and subject to change.

setMinWidth

public void setMinWidth(int minWidth)

setMaxWidth

public void setMaxWidth(int maxWidth)