@@ -8,31 +8,31 @@ import androidx.fragment.app.Fragment
88
99/* *
1010* This class serves as a workaround to https://github.com/software-mansion/react-native-screens/issues/17.
11- *
12- * This fragment, when attached to the fragment manager & its state is progressed
13- * to `ON_CREATED`, attempts to detach itself from the parent fragment manager
11+ *
12+ * This fragment, when attached to the fragment manager & its state is progressed
13+ * to `ON_CREATED`, attempts to detach itself from the parent fragment manager
1414* as soon as possible.
15- *
16- * Instances of this type should be created in place of regular screen fragments
15+ *
16+ * Instances of this type should be created in place of regular screen fragments
1717* when Android restores fragments after activity / application restart.
1818* If done so, it's behaviour can prevent duplicated fragment instances,
1919* as React will render new ones on activity restart.
2020*/
21- class AutoRemovingFragment : Fragment () {
22-
21+ class AutoRemovingFragment : Fragment () {
2322 override fun onCreate (savedInstanceState : Bundle ? ) {
2423 super .onCreate(savedInstanceState)
2524
26- // This is the first moment where we have access to non-null parent fragment manager,
27- // so that we can remove the fragment from the hierarchy.
28- parentFragmentManager.beginTransaction()
25+ // This is the first moment where we have access to non-null parent fragment manager,
26+ // so that we can remove the fragment from the hierarchy.
27+ parentFragmentManager
28+ .beginTransaction()
2929 .remove(this )
3030 .commitAllowingStateLoss()
3131 }
3232
3333 override fun onCreateView (
3434 inflater : LayoutInflater ,
3535 container : ViewGroup ? ,
36- savedInstanceState : Bundle ?
36+ savedInstanceState : Bundle ? ,
3737 ): View ? = null
3838}
0 commit comments