Class NativeViewsObserver

  • All Implemented Interfaces:

    
    public final class NativeViewsObserver
    
                        

    Observer 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.

    • 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

      • 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.