amar_1995
11/15/2019, 7:04 AMsetViewContent
which accept composable function as input parameter similar to setContent
. So I want know what is a diference between setViewContent
and setContent
and its use-cases.
And my second question is that setContent
and setViewContent
both return CompositionContext?
. So what is the usage of CompositionContext ?Leland Richardson [G]
11/15/2019, 7:27 PMandroidx.ui.*
. We call this “compose UI”. This uses compose runtime to target a tree of `ComponentNode`s. One can also use compose runtime to target a tree of `View`s. Right now, setViewContent
is used for the latter, and setContent
for the former. We are investigating different ways to switch between the two, but exactly how this will work is still being decided. Similarly, the exact shape of these functions may change, and the return value as well. Right now the return value is mostly used in testing. Using it is largely an “advanced usage” area and the exact API we expose on CompositionContext is likely to change pretty significantly, but you rarely need it, so i wouldn’t worry about it for now 😉