Class LoadingState
-
- All Implemented Interfaces:
-
com.inmobi.media.ads.common.base.state.State,com.inmobi.media.ads.common.listeners.AUMDestroyListener,com.inmobi.media.ads.common.listeners.InternalLoadTimeoutListener
public abstract class LoadingState extends AdComponentWrapper implements State, InternalLoadTimeoutListener, AUMDestroyListener
Represents the state when an ad unit is actively loading and rendering content.
This abstract state manages the ad loading process by initiating the AdUnit inflation, handling load failures, and managing timeout scenarios. It implements listeners for internal load timeouts and destruction events. The state can transition to LoadFailedState on failures or timeouts, or to LoadedState upon successful loading completion.
-
-
Field Summary
Fields Modifier and Type Field Description private final AdUnitadUnitprivate final ContextapplicationContextprivate final CoroutineScopeadManagerScopeprivate final AdContextadContextprivate final AdConfigadConfigprivate final PubSettingspubSettingsprivate final AdContext.ViewabilityContextviewabilityprivate final AdMetaInfoadMetaInfoprivate final MetaInfometaInfoprivate final InMobiLoggerloggerprivate final AdLifecycleDataadLifecycleDataprivate final AdManagerTelemetryHelperadManagerTelemetryHelper
-
Constructor Summary
Constructors Constructor Description LoadingState(AdComponent adComponent, AdUnitTimeoutManager adUnitTimeout, PublisherCallbacks publisherCallbacks, AUMStateMachine stateMachine)
-
Method Summary
Modifier and Type Method Description abstract AdUnitgetAdUnit()The ad unit instance responsible for rendering the ad content Unitinitialize()Initializes the loading state and begins the ad inflation process. final UnitonLoadFailure(Short errorCode, InMobiAdRequestStatus status)Handles ad load failure events. UnitonInternalLoadTimeout()Handles internal load timeout events during the loading process. UnitonDestroy()Handles destruction of the ad unit manager. -
Methods inherited from class com.inmobi.media.ads.context.wrapper.AdComponentWrapper
getAdConfig, getAdContext, getAdLifecycleData, getAdManagerScope, getAdManagerTelemetryHelper, getAdMetaInfo, getApplicationContext, getLogger, getMetaInfo, getPubSettings, getViewability -
Methods inherited from class com.inmobi.media.ads.common.base.state.State
cleanUp -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
LoadingState
LoadingState(AdComponent adComponent, AdUnitTimeoutManager adUnitTimeout, PublisherCallbacks publisherCallbacks, AUMStateMachine stateMachine)
-
-
Method Detail
-
initialize
Unit initialize()
Initializes the loading state and begins the ad inflation process.
This method notifies the timeout manager that loading has started and initiates the ad unit inflation process for rendering the ad content.
-
onLoadFailure
final Unit onLoadFailure(Short errorCode, InMobiAdRequestStatus status)
Handles ad load failure events.
This method is called when the ad unit reports a load failure and transitions to LoadFailedState with the provided error details.
- Parameters:
errorCode- The error code associated with the load failurestatus- The InMobiAdRequestStatus describing the failure
-
onInternalLoadTimeout
Unit onInternalLoadTimeout()
Handles internal load timeout events during the loading process.
This method determines the appropriate error code based on network connectivity and transitions to LoadFailedState with timeout details.
-
onDestroy
Unit onDestroy()
Handles destruction of the ad unit manager.
Transitions to DestroyedState for proper cleanup, preserving the ad unit and timeout manager for final cleanup operations.
-
-
-
-