Kevin Hester
03/04/2020, 7:01 PMLeland Richardson [G]
03/04/2020, 7:11 PMKevin Hester
03/04/2020, 7:23 PMonCommit(AppStatus.currentScreen)
instead on onActive (on line 68) and that was quite a bit better, though the onCommit closure still gets run after this screen has been deselected (once) which is not really ideal. So ideally I would have some sort of hook so I could get my closure invoked for "onShown" or "onHidden"Leland Richardson [G]
03/04/2020, 7:40 PMKevin Hester
03/04/2020, 7:41 PMLeland Richardson [G]
03/04/2020, 7:46 PMOnPositioned
is an API that can get you part of the way there right now, but it gets called a lot more than you’d want obviouslyKevin Hester
03/04/2020, 7:49 PMLeland Richardson [G]
03/04/2020, 7:50 PMKevin Hester
03/04/2020, 7:52 PMLeland Richardson [G]
03/04/2020, 8:02 PMonCommit
providesKevin Hester
03/04/2020, 8:03 PMLeland Richardson [G]
03/04/2020, 8:04 PMonCommit
isn’t working for you there is because Crossfade
has an implementation which keeps the “old hierarchy” around while it is animating it outKevin Hester
03/04/2020, 8:05 PMLeland Richardson [G]
03/04/2020, 8:11 PMKevin Hester
03/04/2020, 8:12 PMLeland Richardson [G]
03/04/2020, 9:43 PMif (x) { Foo() } else { Bar() }
and then
@Composable fun Foo() { analyticsScreen("foo") ... }
This is going to call onCommit every time foo is added/removed from the tree, which will happen every time x
changedKevin Hester
03/04/2020, 9:44 PM