Last active
October 18, 2019 13:10
-
-
Save safaorhan/af0935ddc69fe91b3146a075caa1e3e2 to your computer and use it in GitHub Desktop.
Disables the child attach listener so that inflated children with wrap_content heights can pass.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Disables the child attach listener so that inflated children with wrap_content heights can pass. | |
* | |
* This is very fragile and depends on the implementation details of [ViewPager2]. | |
* | |
* @see ViewPager2.enforceChildFillListener (the removed listener) | |
*/ | |
private fun ViewPager2.removeMatchParentCheckForChildren() { | |
(getChildAt(0) as RecyclerView).clearOnChildAttachStateChangeListeners() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment