PoolingContainer
public final class PoolingContainer
Summary
Public methods |
|
|---|---|
static final void |
addPoolingContainerListener(Add a callback for when this View should dispose its resources. |
static final void |
callPoolingContainerOnRelease(@NonNull View receiver)Calls |
static final void |
Calls |
static final boolean |
isPoolingContainer(@NonNull View receiver)Whether this View is a container that manages the lifecycle of its child Views. |
static final boolean |
isWithinPoolingContainer(@NonNull View receiver)Whether one of this View's ancestors has |
static final void |
removePoolingContainerListener(Remove a callback that was previously added by |
static final void |
setPoolingContainer(@NonNull View receiver, boolean isPoolingContainer)Whether this View is a container that manages the lifecycle of its child Views. |
Public methods
addPoolingContainerListener
public static final void addPoolingContainerListener(
@NonNull View receiver,
@NonNull PoolingContainerListener listener
)
Add a callback for when this View should dispose its resources.
| Parameters | |
|---|---|
@NonNull View receiver |
the child view to receive callbacks regarding |
@NonNull PoolingContainerListener listener |
the listener that produces onRelease callbacks, triggering resource disposal |
callPoolingContainerOnRelease
public static final void callPoolingContainerOnRelease(@NonNull View receiver)
Calls PoolingContainerListener.onRelease on any PoolingContainerListeners attached to this View or any of its children.
At the point when this is called, the View should be detached from the window.
callPoolingContainerOnReleaseForChildren
public static final void callPoolingContainerOnReleaseForChildren(@NonNull ViewGroup receiver)
Calls PoolingContainerListener.onRelease on any PoolingContainerListeners attached to any of its children (not including the ViewGroup itself)
At the point when this is called, the View should be detached from the window.
isPoolingContainer
public static final boolean isPoolingContainer(@NonNull View receiver)
Whether this View is a container that manages the lifecycle of its child Views.
Any View that sets this to true must call callPoolingContainerOnRelease on child Views before they are discarded and may possibly not be used in the future. This includes when the view itself is detached from the window, unless it is being held for possible later reattachment and its children should not release their resources.
Warning: Failure to call callPoolingContainerOnRelease when a View is removed from the hierarchy and discarded is likely to result in memory leaks!
isWithinPoolingContainer
public static final boolean isWithinPoolingContainer(@NonNull View receiver)
Whether one of this View's ancestors has isPoolingContainer set to true
removePoolingContainerListener
public static final void removePoolingContainerListener(
@NonNull View receiver,
@NonNull PoolingContainerListener listener
)
Remove a callback that was previously added by addPoolingContainerListener
setPoolingContainer
public static final void setPoolingContainer(@NonNull View receiver, boolean isPoolingContainer)
Whether this View is a container that manages the lifecycle of its child Views.
Any View that sets this to true must call callPoolingContainerOnRelease on child Views before they are discarded and may possibly not be used in the future. This includes when the view itself is detached from the window, unless it is being held for possible later reattachment and its children should not release their resources.
Warning: Failure to call callPoolingContainerOnRelease when a View is removed from the hierarchy and discarded is likely to result in memory leaks!