Prevent GoneOnInvisibleListener leak
This commit is contained in:
@@ -19,5 +19,10 @@ class GoneOnInvisibleListener(
|
||||
|
||||
fun attach() {
|
||||
view.viewTreeObserver.addOnGlobalLayoutListener(this)
|
||||
onGlobalLayout()
|
||||
}
|
||||
}
|
||||
|
||||
fun detach() {
|
||||
view.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user