Class DynamicInterstitialAd
java.lang.Object
com.pranavpandey.android.dynamic.ads.DynamicBaseAd
com.pranavpandey.android.dynamic.ads.factory.DynamicInterstitialAd
- All Implemented Interfaces:
SharedPreferences.OnSharedPreferenceChangeListener,DynamicAd
public class DynamicInterstitialAd
extends DynamicBaseAd
implements SharedPreferences.OnSharedPreferenceChangeListener
A
DynamicBaseAd to show an InterstitialAd dynamically throughout the app.-
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
ConstructorsConstructorDescriptionDynamicInterstitialAd(String adUnitId, InterstitialAdListener dynamicAdListener) Constructor to initialize an object of this class.DynamicInterstitialAd(String adUnitId, InterstitialAdListener dynamicAdListener, long eventCount) Constructor to initialize an object of this class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the optional layout resource for this ad.Returns the listener used by this ad.Returns the unit id for this ad.com.google.android.ump.ConsentFormReturns the consent form if available.com.google.android.ump.ConsentInformationReturns the consent information if available.protected com.google.android.gms.ads.FullScreenContentCallbackReturns the optional full screen content callback.booleanChecks if any constraints should be matched before loading the ad.booleanChecks whether the ad has been loaded.voidTry to create the new ad.voidTry to destroy the ad instances and do cleanup.voidTry to pause the running ad.voidTry to resume the paused ad.voidThis method will be called to do the initialization.voidonSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) voidTry to call the ad display event for the loaded interstitial ad after comparing the ad event count.Methods inherited from class com.pranavpandey.android.dynamic.ads.DynamicBaseAd
getAdRequest, getAdRequestConfigurations, isAdVisible, onCustomiseAd, onPostAdLoaded, setAdVisible
-
Constructor Details
-
Method Details
-
getAdUnitId
Description copied from interface:DynamicAdReturns the unit id for this ad.- Specified by:
getAdUnitIdin interfaceDynamicAd- Returns:
- The unit id for this ad.
-
getAdLayoutRes
Description copied from interface:DynamicAdReturns the optional layout resource for this ad.- Specified by:
getAdLayoutResin interfaceDynamicAd- Returns:
- The optional layout resource for this ad.
-
getAdListener
Description copied from interface:DynamicAdReturns the listener used by this ad.- Specified by:
getAdListenerin interfaceDynamicAd- Returns:
- The listener used by this ad.
-
onInitialize
public void onInitialize()Description copied from interface:DynamicAdThis method will be called to do the initialization.- Specified by:
onInitializein interfaceDynamicAd
-
getConsentInformation
Description copied from interface:DynamicAdReturns the consent information if available.- Specified by:
getConsentInformationin interfaceDynamicAd- Returns:
- The consent information if available.
-
getConsentForm
Description copied from interface:DynamicAdReturns the consent form if available.- Specified by:
getConsentFormin interfaceDynamicAd- Returns:
- The consent form if available.
-
getFullScreenContentCallback
@Nullable protected com.google.android.gms.ads.FullScreenContentCallback getFullScreenContentCallback()Returns the optional full screen content callback.- Returns:
- The optional full screen content callback.
-
onAdCreate
public void onAdCreate()Description copied from interface:DynamicAdTry to create the new ad.- Specified by:
onAdCreatein interfaceDynamicAd
-
isAdAllowed
public boolean isAdAllowed()Description copied from interface:DynamicAdChecks if any constraints should be matched before loading the ad.- Specified by:
isAdAllowedin interfaceDynamicAd- Overrides:
isAdAllowedin classDynamicBaseAd- Returns:
trueif the ad is allowed to be loaded.
-
isAdLoaded
public boolean isAdLoaded()Description copied from interface:DynamicAdChecks whether the ad has been loaded.- Specified by:
isAdLoadedin interfaceDynamicAd- Returns:
trueif the ad has been loaded.
-
populateAd
public void populateAd()Try to call the ad display event for the loaded interstitial ad after comparing the ad event count.- Specified by:
populateAdin interfaceDynamicAd- Overrides:
populateAdin classDynamicBaseAd- See Also:
-
EventAdListener.getAdEventCount()InterstitialAdListener.onAdDisplay(InterstitialAd)InterstitialAd.show(Activity)
-
onAdResume
public void onAdResume()Description copied from interface:DynamicAdTry to resume the paused ad.- Specified by:
onAdResumein interfaceDynamicAd
-
onAdPause
public void onAdPause()Description copied from interface:DynamicAdTry to pause the running ad. -
onAdDestroy
public void onAdDestroy()Description copied from interface:DynamicAdTry to destroy the ad instances and do cleanup.- Specified by:
onAdDestroyin interfaceDynamicAd- Overrides:
onAdDestroyin classDynamicBaseAd
-