There are a few posts on getting ViewPager to work with varying height items that center around extending
ViewPager itself to modify its
onMeasure to support this.
However, given that
ViewPager2 is marked as a final class, extending it isn't something that we can do.
Does anyone know if there’s a way to make this work out?
The solution is to register a
PageChangeCallback and adjust the
LayoutParams of the
ViewPager2 after asking the child to…