Class AttachedStateCollector
-
- All Implemented Interfaces:
-
kotlinx.coroutines.flow.FlowCollector
public final class AttachedStateCollector implements FlowCollector<Boolean>
Flow collector that manages window visibility observation based on view attachment state.
This collector starts visibility observation when the view is attached to the window and stops it when detached. It handles the transition between different observation strategies based on the Android API level and manages the lifecycle of observation jobs.
-
-
Constructor Summary
Constructors Constructor Description AttachedStateCollector(CoroutineScope coroutineScope, View observableView, MutableStateFlow<Boolean> visibilityStateFlow, Long windowPollingInterval, InMobiLogger logger)
-
Method Summary
-
-
Constructor Detail
-
AttachedStateCollector
AttachedStateCollector(CoroutineScope coroutineScope, View observableView, MutableStateFlow<Boolean> visibilityStateFlow, Long windowPollingInterval, InMobiLogger logger)
- Parameters:
coroutineScope- The CoroutineScope for launching visibility observationobservableView- The View being observed for visibility changesvisibilityStateFlow- The MutableStateFlow to emit visibility state changes towindowPollingInterval- The polling interval for older Android versions
-
-
-
-