Package 

Class ImageLoader


  • 
    public final class ImageLoader
    
                        

    ImageLoader is responsible for asynchronously loading and displaying image ads, including tracking impressions and handling click interactions.

    • Method Summary

      Modifier and Type Method Description
      final Unit setErrorCallback(ErrorCallback callback) Set an error callback to handle errors that occur during image loading.
      final Unit clearErrorCallback() Clear the error callback to prevent memory leaks.
      final Unit setViewLoadListener(Function2<ImageAd, String, Unit> listener) Sets a listener to be notified when the ad view is fully loaded.
      final Unit clearViewLoadListener() Clear the view load listener to prevent memory leaks
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageLoader

        ImageLoader(CoroutineScope coroutineScope, AdTrackerInterface adTracker)
        Parameters:
        coroutineScope - The CoroutineScope in which image loading and tracking operations are executed.
        adTracker - A utility class responsible for tracking ad impressions and clicks.
    • Method Detail

      • setErrorCallback

         final Unit setErrorCallback(ErrorCallback callback)

        Set an error callback to handle errors that occur during image loading.

        Parameters:
        callback - Callback that handles error scenarios with structured error information.
      • setViewLoadListener

         final Unit setViewLoadListener(Function2<ImageAd, String, Unit> listener)

        Sets a listener to be notified when the ad view is fully loaded.

        Parameters:
        listener - Callback receiving the loaded ImageAd and its tracking ID.