@@ -8,31 +8,31 @@ import androidx.fragment.app.Fragment
8
8
9
9
/* *
10
10
* 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
14
14
* 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
17
17
* when Android restores fragments after activity / application restart.
18
18
* If done so, it's behaviour can prevent duplicated fragment instances,
19
19
* as React will render new ones on activity restart.
20
20
*/
21
- class AutoRemovingFragment : Fragment () {
22
-
21
+ class AutoRemovingFragment : Fragment () {
23
22
override fun onCreate (savedInstanceState : Bundle ? ) {
24
23
super .onCreate(savedInstanceState)
25
24
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()
29
29
.remove(this )
30
30
.commitAllowingStateLoss()
31
31
}
32
32
33
33
override fun onCreateView (
34
34
inflater : LayoutInflater ,
35
35
container : ViewGroup ? ,
36
- savedInstanceState : Bundle ?
36
+ savedInstanceState : Bundle ? ,
37
37
): View ? = null
38
38
}
0 commit comments