Class NativeAdUnitStateMachine
-
- All Implemented Interfaces:
-
com.inmobi.media.ads.common.listeners.AUDestroyListener,com.inmobi.media.ads.nativeAd.listeners.RegisterTrackingListener,com.inmobi.media.ads.nativeAd.listeners.UnTrackListener
public final class NativeAdUnitStateMachine extends AdUnitStateMachine implements RegisterTrackingListener, UnTrackListener
State machine for managing the lifecycle and state transitions of a native ad unit. This class extends AdUnitStateMachine to provide native ad-specific state management, handling transitions between created, loaded, and rendered states.
-
-
Constructor Summary
Constructors Constructor Description NativeAdUnitStateMachine(NativeAdUnitComponent nativeAdUnitComponent)
-
Method Summary
Modifier and Type Method Description Unitinflate()Inflates the ad unit if it's in the created state. UnitregisterViewForTracking(InMobiNativeViewData inMobiNativeViewData)Registers the provided view data for tracking if the ad is in the loaded state. UnitunTrackViews()Removes tracking from all registered views if the current state supports untracking. final UnittakeAction()Handles user actions (such as clicks) on the native ad if it's in the rendered state. -
Methods inherited from class com.inmobi.media.ads.common.adUnit.state.AdUnitStateMachine
onDestroy -
Methods inherited from class com.inmobi.media.ads.common.base.state.StateMachine
changeState, changeStateSuspending -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
NativeAdUnitStateMachine
NativeAdUnitStateMachine(NativeAdUnitComponent nativeAdUnitComponent)
- Parameters:
nativeAdUnitComponent- The dependency injection component providing required dependencies.
-
-
Method Detail
-
inflate
Unit inflate()
Inflates the ad unit if it's in the created state. This method triggers the inflation process for the native ad.
-
registerViewForTracking
Unit registerViewForTracking(InMobiNativeViewData inMobiNativeViewData)
Registers the provided view data for tracking if the ad is in the loaded state. This method enables impression and click tracking for the native ad views.
- Parameters:
inMobiNativeViewData- The view data containing all views that need to be tracked.
-
unTrackViews
Unit unTrackViews()
Removes tracking from all registered views if the current state supports untracking. This method cleans up view tracking and can transition the ad to an untracked state.
-
takeAction
final Unit takeAction()
Handles user actions (such as clicks) on the native ad if it's in the rendered state. This method triggers appropriate actions when users interact with the ad.
-
-
-
-