com.google.android.gms.ads.formats.NativeCustomTemplateAd |
A native custom template ad. In addition to NativeContentAd
and NativeAppInstallAd
, custom templates let you define and render your own assets, and allows you
to define the click behavior of the ad.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NativeCustomTemplateAd.OnCustomClickListener | An interface defining a callback that is called when a user clicks on a custom template native ad that has a custom click action. | ||||||||||
NativeCustomTemplateAd.OnCustomTemplateAdLoadedListener | An interface defining a callback that is called when a native custom template ad is loaded. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ASSET_NAME_VIDEO | The asset name associated with the MediaView returned by getVideoMediaView() . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Destroys the ad object.
| |||||||||||
Returns a list of all available assets.
| |||||||||||
Returns the ID of the custom template used to request this ad.
| |||||||||||
Returns an image asset.
| |||||||||||
Returns a string asset of numbers, URLs, or other types other than an image asset.
| |||||||||||
Returns the
VideoController associated with this ad. | |||||||||||
Returns a MediaView containing this ad's video conten or null if there is no video content.
| |||||||||||
Called when the user has clicked on the ad.
| |||||||||||
Ping impression URLs and record the impression.
|
The asset name associated with the MediaView
returned by getVideoMediaView()
.
This is the asset name that will be reported in onCustomClick(NativeCustomTemplateAd, String)
when the user clicks on the video MediaView.
Destroys the ad object. No other methods should be called on the ad object after destroy()
is called.
Returns a list of all available assets.
Returns | |
---|---|
List<String> |
a list of all available assets, or an empty list if no asset is available. |
Returns the ID of the custom template used to request this ad.
Returns | |
---|---|
String |
Returns an image asset.
Parameters | |
---|---|
assetName |
String :
The name of the asset to be retrieved. |
Returns | |
---|---|
NativeAd.Image |
the value of the asset with the asset name, or null if there's no such asset name. |
Returns a string asset of numbers, URLs, or other types other than an image asset.
Parameters | |
---|---|
assetName |
String :
The name of the asset to be retrieved. |
Returns | |
---|---|
CharSequence |
the value of the asset with the asset name, or null if there's no such asset name. |
Returns the VideoController
associated with this ad. This is never null. To check if an
ad has video content, call the hasVideoContent()
method on the returned
VideoController
object.
Returns | |
---|---|
VideoController |
Returns a MediaView containing this ad's video conten or null if there is no video content.
Returns | |
---|---|
MediaView |
Called when the user has clicked on the ad.
Parameters | |
---|---|
assetName |
String :
The name of the asset that is performed the click.
|
Ping impression URLs and record the impression. Called when the ad is first displayed.