Vinay Gaba
03/05/2021, 3:30 AMLayoutInflater.Factory2
gave some of this functionality in classic Android. Just curious if something like this already exists or is planned for in Compose.Adam Powell
03/05/2021, 3:36 AMVinay Gaba
03/05/2021, 3:38 AMVinay Gaba
03/05/2021, 3:42 AMVinay Gaba
03/05/2021, 6:25 AMInspectorInfo
does and if that could somehow be leveraged?Zach Klippenstein (he/him) [MOD]
03/05/2021, 7:08 AMZach Klippenstein (he/him) [MOD]
03/05/2021, 7:12 AMUiApplier
type that is used by the android composition? That used to be possible, not sure if it’s been locked down in recent versions. If you can wrap the applier though, you could get nice granular and immediate notifications any time LayoutNodes are added/removed. That type is internal now, so you might need reflection to read their bounds, and i’m not sure if there’s a way to directly listen to them for remeasure/relayout events, but if there is that might work. Of course you’d need a custom entry point as well then, couldn’t just use setContent
anymore.Adam Powell
03/05/2021, 2:50 PMAdam Powell
03/05/2021, 2:52 PMAdam Powell
03/05/2021, 2:54 PMVinay Gaba
03/05/2021, 4:44 PMVinay Gaba
03/05/2021, 4:50 PMthe preference for hoisted state objects as APIOn a related note, I’m curious about how state hoisting relates to not allowing manipulation of composable functions?
Adam Powell
03/05/2021, 4:56 PMAdam Powell
03/05/2021, 4:57 PMAdam Powell
03/05/2021, 4:57 PMVinay Gaba
03/05/2021, 5:09 PMComposeView
and inject this view directly at the top of the window/hierarchy.
2. The second idea is to somehow wrap every single Composable inside a ComposeView
when a certain debug menu is enabled. Since every single composable is noew effectively a classic Android view as I wrap them inside ComposeView, I can just rely on LayoutInflater.Factory2
to get the callbacks I need.Vinay Gaba
03/05/2021, 5:11 PMAdam Powell
03/05/2021, 5:15 PMAdam Powell
03/05/2021, 5:15 PMVinay Gaba
03/05/2021, 6:04 PMAdam Powell
03/05/2021, 7:01 PMZach Klippenstein (he/him) [MOD]
03/05/2021, 8:19 PMVinay Gaba
03/05/2021, 8:50 PMVinay Gaba
03/05/2021, 8:52 PM