Class ViewHierarchyHandlerKt
-
- All Implemented Interfaces:
public final class ViewHierarchyHandlerKt
-
-
Method Summary
Modifier and Type Method Description final static <Error class: unknown class>observeViewAttachedToParent(View view, View parentView, CoroutineScope coroutineScope)Observes whether the given view is attached to the parentView in the view hierarchy. -
-
Method Detail
-
observeViewAttachedToParent
final static <Error class: unknown class> observeViewAttachedToParent(View view, View parentView, CoroutineScope coroutineScope)
Observes whether the given view is attached to the parentView in the view hierarchy.
This function creates a reactive flow that monitors the attachment state of a view relative to its parent view. It emits true when the view is attached to both the parent view and the window, and false otherwise. The observation is handled asynchronously using coroutines and is managed within the provided scope.
- Parameters:
view- The child View to observe for attachment state changesparentView- The parent View to check attachment againstcoroutineScope- The CoroutineScope for managing the observation lifecycle- Returns:
A StateFlow<Boolean> that emits true when the view is properly attached, false otherwise
-
-
-
-