stop
fun stop()
Content copied to clipboard
Removes any listeners from the view so that we no longer observe inset changes.
This is only required to be called from hosts which have a shorter lifetime than the view. For example, if you're using ViewWindowInsetObserver from a @Composable function, you should call stop from an onDispose block, like so:
DisposableEffect(view) {
val observer = ViewWindowInsetObserver(view)
// ...
onDispose {
observer.stop()
}
}Whereas if you're using this class from a fragment (or similar), it is not required to call this function since it will live as least as longer as the view.