override fun detachedFromWindow() { adapterObserver?.let { adapterRef?.unregisterAdapterDataObserver(it) adapterObserver = null } }
[RecyclerView.AdapterDataObserver]s are responsible to be unregistered when they are done, so we do that here when our [TrayPagerAdapter] page is detached from the window.