Dan Peluso
03/09/2021, 8:13 PMDan Peluso
03/09/2021, 8:16 PMval dataFlow = produceValues().subscribeAsState(initial = 0)
this is in my main view, produceValues()
simply spits out a long every 5 seconds. I'm passing the state as a parameter to a Composable which is supposed to render the graph:
@Composable
fun renderGraph(state: State<Long>, plotType: PlotType) {
AndroidView(
factory = {
// creates the chart
},
modifier = Modifier.fillMaxSize(),
update = {
state.value.let { x: Long ->
// change the graph's data based on this long
}
}
)
}
Dan Peluso
03/09/2021, 8:18 PMSergey Y.
03/09/2021, 8:37 PMDan Peluso
03/09/2021, 10:55 PM