dakinne
11/19/2019, 3:39 PMfun newInstance(
onSizeSelected: () -> Unit = {}
) = SizesFragment().apply {
arguments = Bundle().apply {
putSerializable(ON_SIZE_SELECTED, onSizeSelected )
}
}
Pablichjenkov
11/19/2019, 4:58 PMthis.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.dawidhyzy
11/19/2019, 5:08 PMPablichjenkov
11/19/2019, 5:13 PM