-
public final class ImageLoaderImageLoader is responsible for asynchronously loading and displaying image ads, including tracking impressions and handling click interactions.
-
-
Constructor Summary
Constructors Constructor Description ImageLoader(CoroutineScope coroutineScope, AdTrackerInterface adTracker)
-
Method Summary
Modifier and Type Method Description final UnitsetErrorCallback(ErrorCallback callback)Set an error callback to handle errors that occur during image loading. final UnitclearErrorCallback()Clear the error callback to prevent memory leaks. final UnitsetViewLoadListener(Function2<ImageAd, String, Unit> listener)Sets a listener to be notified when the ad view is fully loaded. final UnitclearViewLoadListener()Clear the view load listener to prevent memory leaks -
-
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.
-
clearErrorCallback
final Unit clearErrorCallback()
Clear the error callback to prevent memory leaks.
-
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.
-
clearViewLoadListener
final Unit clearViewLoadListener()
Clear the view load listener to prevent memory leaks
-
-
-
-