A Groww engineer walks through building a custom Android RecyclerView LayoutManager for an options trading screen. The post covers two failed approaches — syncing three separate RecyclerViews and writing a LayoutManager from scratch — before landing on the winning solution: extending LinearLayoutManager and using translationX to simulate mirrored horizontal scrolling on call/put columns while keeping the strike price column fixed. Key implementation steps include dimension calculation, enabling horizontal scroll per touch region, intercepting scroll deltas, applying translationX to ViewHolders, and persisting horizontal offset across configuration changes.
Table of contents
The Winning Approach: Extend LinearLayoutManagerWhy translationX instead of real scroll?1.8K Impressions