[library] Inline smooth scroller computation in anonymous class