Hi, I have a use case where my title can have a different length. What I am trying to achieve is to have the collapsing toolbar size dynamically calculated during composition.
I have introduced the var titleHeight = remember { mutableStateOf(0.0) } variable which is calculated in modifier like this
The brown view is the one I measure during the composition. When I hardcode measured value then it works perfectly but when it is calculated then the progress value is wrongly calculated. The list can be manually scrolled and after that toolbar it rendered corectly.
Hi, I have a use case where my title can have a different length. What I am trying to achieve is to have the collapsing toolbar size dynamically calculated during composition. I have introduced the
var titleHeight = remember { mutableStateOf(0.0) }
variable which is calculated in modifier like this.onGloballyPositioned { textLayoutResultState.value = it.size.height }
Current behaviour:
Intended behaviour:
The brown view is the one I measure during the composition. When I hardcode measured value then it works perfectly but when it is calculated then the progress value is wrongly calculated. The list can be manually scrolled and after that toolbar it rendered corectly.
Any ideas how to resolve that issue?