MaterialViewPager is a library that creates a scrollable, swipeable interface with an animated header image, toolbar, and logo following Material Design guidelines. It provides a complete implementation of a Material Design ViewPager, where the header background color and image animate as the user swipes between pages.
The library coordinates scroll-driven header animations by synchronising scroll offsets from the ViewPager and attached scrollable views through a central coordinator. It supports fragment-based page composition, allowing each page to have independent content layouts while sharing a common header. The toolbar behavior can be configured to hide, stick, or become transparent based on scroll position, managed through a finite state machine driven by scroll position thresholds.
MaterialViewPager includes a pluggable header layout system that supports swapping between default, custom, Ken Burns effect, or static image layouts. It also offers a tab bar strategy pattern that switches between standard, news-stand, or custom tab bar implementations. The library integrates with RecyclerViews and ScrollViews through an observable scroll view abstraction, and derives header background colors from the current page's dominant image palette using a lightweight color extraction algorithm.