Class StaticExperienceManager
-
- All Implemented Interfaces:
public final class StaticExperienceManager extends BaseExperienceManager
Manages the display of a static image experience within a MediaView.
This class is responsible for loading and displaying a static image based on the provided StaticExperienceModel. It handles image loading, error handling, and click events.
-
-
Constructor Summary
Constructors Constructor Description StaticExperienceManager(Context context, CoroutineScope coroutineScope, StaticExperienceModel staticExperienceModel, MutableSharedFlow<MediaEvent> mediaEventFlow, InMobiLogger logger)
-
Method Summary
Modifier and Type Method Description Unitload()Loads and displays a static image experience. <Error class: unknown class>inflate(FrameLayout parentLayout)Inflates the static image view into the provided parent layout. UnitattachWindowLifecycleObserver(Flow<Boolean> windowFlow)Attaches window lifecycle observer (No-op for static experiences). UnitdetachObserversAndPause()Detaches observers and pauses the experience (No-op for static experiences). Unitdestroy()Destroys the static experience and releases resources. -
-
Constructor Detail
-
StaticExperienceManager
StaticExperienceManager(Context context, CoroutineScope coroutineScope, StaticExperienceModel staticExperienceModel, MutableSharedFlow<MediaEvent> mediaEventFlow, InMobiLogger logger)
-
-
Method Detail
-
load
Unit load()
Loads and displays a static image experience.
This method prepares the static image content by sanitizing and sorting available images, then loading the most suitable image into the image view. It handles error cases and emits appropriate telemetry events.
-
inflate
<Error class: unknown class> inflate(FrameLayout parentLayout)
Inflates the static image view into the provided parent layout.
This method adds the prepared image view to the parent layout with appropriate layout parameters, centering it within the container.
- Parameters:
parentLayout- The FrameLayout where the static image view will be added.
-
attachWindowLifecycleObserver
Unit attachWindowLifecycleObserver(Flow<Boolean> windowFlow)
Attaches window lifecycle observer (No-op for static experiences).
Static images don't require window lifecycle management as they don't have dynamic content that needs to be paused/resumed based on visibility.
- Parameters:
windowFlow- A flow indicating window visibility state (ignored for static content).
-
detachObserversAndPause
Unit detachObserversAndPause()
Detaches observers and pauses the experience (No-op for static experiences).
Static images don't have active observers or dynamic content that needs to be paused, so this method performs no operations.
-
-
-
-