"If you control the Fragment instantiation", then you can have a public field an set it up inside the apply lambda.
this.mOnSizeSelected = onSizeSelected
You don't need the arguments API if you control the Fragment instantiation. Public fields makes your UI smoother since they don't require serialization.
d
dawidhyzy
11/19/2019, 5:08 PM
@Pablichjenkov how do you solve configuration change in this case? This is very bad solution.
BTW. This question is not related to Kotlin. Check channel rules.
👆 1
p
Pablichjenkov
11/19/2019, 5:13 PM
Definitely is not a good solution considering configuration changes.
Not sure if the new FragmentFactory API is used when Fragments are recreated from configuration changes. In such a case, it is safe to do direct field setup.
Yeah it is out of the scope of kotlin.