[JetSnack] Move scroll state reads into layout phase via lambdas by bentrengrove · Pull Request #778 · android/compose-samples

Fixes janky scrolling on the JetSnack details page.
Fixes #231

It should not be necessary to recompose just to relayout a page. JetSnack has a collapsing toolbar like layout on the details page, it shrinks the image and moves the title text up on scroll. This was previously done using composition but by moving the read of the scroll value into a lambda, we can read the value only during layout and skip the composition phase entirely.