Dmitry Fabrichny
12/21/2022, 5:06 AMPaddingValue
which is then passed to LazyColumn(contentPadding = ...)
doesn't actually use the new padding inside of the rememberLazyListMeasurePolicy
. The bottom padding is updated with the keyboard height everytime it appears/disappears. I'm placing two breakpoints 1. Inside of the internal fun LazyList(...)
function on state.placementAnimator = placementAnimator
line. 2. Inside of the private fun rememberLazyListMeasurePolicy()
function on checkScrollableContainerConstraints()
line. Then I'm clicking a textfield to make the keyboard appear. Once the first breakpoint is hit I first check that the bottom padding is the value I'm expecting to see (~300dp) then I place a new breakpoint inside of PaddingValuesImpl.equals()
method. Then I resume the app, PaddingValuesImpl.equals()
is getting called a couple of times but it's called not from the place I'm expecting it to get called from. I'm expecting a call from remember<LazyLayoutMeasureScope.(Constraints) -> MeasureResult>() { ... }
line which is in rememberLazyListMeasurePolicy()
method but it never gets called from that method. Then the second breakpoint which is on checkScrollableContainerConstraints()
line is getting hit and when I check the contentPadding I'm seeing the old value (24dp). So I'm assuming that the remember<LazyLayoutMeasureScope.(Constraints) -> MeasureResult>() { ... }
doesn't work for some reason in this situation so the lambda is not re-remebered in other words it's the previous lambda that captured the previous contentPadding. I would really like to see what's going on inside remember<LazyLayoutMeasureScope.(Constraints) -> MeasureResult>() { ... }
but I can't place a breakpoint there because it tells me to download the sourse code and when I click download it can't find it. I tried installing the compose-runtime
dependency but it still won't show me the source code of that remember<LazyLayoutMeasureScope.(Constraints) -> MeasureResult>() { ... }
function. This feels like a bug in that one remember function. However I also tried to create a new project and copy some of the code to try and reproduce the issue but it works just fine there (same compose version). So I'm kinda lost now. I'm not sure I should report this on the issue tracker because I have no MRE and it also works in a new test project but doesn't work in the main project. The app I'm developing is open-source so I can provide the whole project if needed.Zach Klippenstein (he/him) [MOD]
12/22/2022, 12:44 AMDmitry Fabrichny
12/22/2022, 4:55 AM