Class DynamicBaseAd
java.lang.Object
com.pranavpandey.android.dynamic.ads.DynamicBaseAd
- All Implemented Interfaces:
DynamicAd
- Direct Known Subclasses:
DynamicAppOpenAd
,DynamicBannerAd
,DynamicInterstitialAd
,DynamicNativeAd
,DynamicRewardedAd
,DynamicRewardedInterstitialAd
An abstract class to implement a
DynamicAd
.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.pranavpandey.android.dynamic.ads.DynamicAd
DynamicAd.Default, DynamicAd.Key, DynamicAd.Value
-
Field Summary
Fields inherited from interface com.pranavpandey.android.dynamic.ads.DynamicAd
CLASS_DYNAMIC_WIDGET, IABTCF_gdprApplies, IABTCF_PurposeConsents, IABTCF_PurposeLegitimateInterests, IABTCF_VendorConsents, IABTCF_VendorLegitimateInterests, LAYOUT_RES_NONE, PREFS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.android.gms.ads.AdRequest
This method will be called to build the ad request for this ad.com.google.android.gms.ads.RequestConfiguration
This method will be called to get the ad request configurations.boolean
Checks if any constraints should be matched before loading the ad.boolean
Returns whether this ad is visible to the user.void
Try to destroy the ad instances and do cleanup.void
onCustomiseAd
(boolean loaded) This method will be called to do the ad customisations.void
onPostAdLoaded
(boolean loaded) This method will be called after the ad has been loaded.void
Try to populate the new ad.void
setAdVisible
(boolean adVisible) Sets whether this ad is visible to the user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pranavpandey.android.dynamic.ads.DynamicAd
getAdLayoutRes, getAdListener, getAdUnitId, getConsentForm, getConsentInformation, isAdLoaded, onAdCreate, onAdPause, onAdResume, onInitialize
-
Constructor Details
-
DynamicBaseAd
public DynamicBaseAd()
-
-
Method Details
-
getAdRequest
Description copied from interface:DynamicAd
This method will be called to build the ad request for this ad.- Specified by:
getAdRequest
in interfaceDynamicAd
- Returns:
- The ad request for this ad.
-
getAdRequestConfigurations
Description copied from interface:DynamicAd
This method will be called to get the ad request configurations.- Specified by:
getAdRequestConfigurations
in interfaceDynamicAd
- Returns:
- The ad request configurations.
-
isAdAllowed
public boolean isAdAllowed()Description copied from interface:DynamicAd
Checks if any constraints should be matched before loading the ad.- Specified by:
isAdAllowed
in interfaceDynamicAd
- Returns:
true
if the ad is allowed to be loaded.
-
onCustomiseAd
public void onCustomiseAd(boolean loaded) Description copied from interface:DynamicAd
This method will be called to do the ad customisations.- Specified by:
onCustomiseAd
in interfaceDynamicAd
- Parameters:
loaded
-true
if the ad was already loaded and using the previous instance.
-
onPostAdLoaded
public void onPostAdLoaded(boolean loaded) Description copied from interface:DynamicAd
This method will be called after the ad has been loaded.- Specified by:
onPostAdLoaded
in interfaceDynamicAd
- Parameters:
loaded
-true
if the ad was already loaded and using the previous instance.
-
populateAd
public void populateAd()Description copied from interface:DynamicAd
Try to populate the new ad.- Specified by:
populateAd
in interfaceDynamicAd
-
isAdVisible
public boolean isAdVisible()Description copied from interface:DynamicAd
Returns whether this ad is visible to the user.- Specified by:
isAdVisible
in interfaceDynamicAd
- Returns:
true
if this ad is visible to the user.
-
setAdVisible
public void setAdVisible(boolean adVisible) Sets whether this ad is visible to the user.- Parameters:
adVisible
-true
if this add is visible to the user.
-
onAdDestroy
public void onAdDestroy()Description copied from interface:DynamicAd
Try to destroy the ad instances and do cleanup.- Specified by:
onAdDestroy
in interfaceDynamicAd
-