Class NativeViewsObserver
-
- All Implemented Interfaces:
public final class NativeViewsObserverObserver class for monitoring native ad view visibility and attachment states. This class tracks the attachment state of native ad views to their parent containers and manages viewability specifications for impression tracking.
-
-
Field Summary
Fields Modifier and Type Field Description private final NativeViewabilityViewHoldernativeViewabilityViewHolder
-
Constructor Summary
Constructors Constructor Description NativeViewsObserver(CoroutineScope coroutineScope, ViewHolderConfig viewabilityModel)
-
Method Summary
Modifier and Type Method Description final NativeViewabilityViewHoldergetNativeViewabilityViewHolder()final UnitstartObservingForViews()Starts observing view attachment states for required views. final UnitstopObservingForViews()Stops observing view attachment states and cleans up resources. -
-
Constructor Detail
-
NativeViewsObserver
NativeViewsObserver(CoroutineScope coroutineScope, ViewHolderConfig viewabilityModel)
- Parameters:
coroutineScope- The coroutine scope for managing lifecycle of observation jobs.viewabilityModel- The viewability configuration model containing view requirements.
-
-
Method Detail
-
getNativeViewabilityViewHolder
final NativeViewabilityViewHolder getNativeViewabilityViewHolder()
-
startObservingForViews
final Unit startObservingForViews()
Starts observing view attachment states for required views. This method begins monitoring whether icon and media views are properly attached to their parent container, updating the visibility specifications accordingly.
-
stopObservingForViews
final Unit stopObservingForViews()
Stops observing view attachment states and cleans up resources. This method cancels all active observation jobs and resets the observation state.
-
-
-
-