Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
jb...@google.com <jb...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
Description
Version used: 1.3.0-alpha04
Devices/Android versions reproduced on: any version
Since all the extension functions for Fragment result API are not "inline", calling setFragmentResultListener requires a double listener allocation: one for the Function2 passed to the extension function, and one for the actual FragmentResultListener that wraps Function2.
This applies for both Fragment.kt and FragmentResultOwner.kt files.
The fix is straightforward: mark the functions as "inline" and the listeners as "crossinline".
Now only the FragmentResultListener will be allocated.