I know this is a broad question but it goes as follows. I have a Fragment that lists TODO tasks. Now I want to add a swipe view - a second page - that lists the already completed tasks. So basically what I want to achieve looks like this:
Just imagine that there are two static pages "TODO" and "DONE"
This means that I need to share the data between the two screens. Also note that these two pages need to have a completely different layout.
I've done research and the brand new ViewPager2 seems to be the way to go. However, the official documentation doesn't really talk about my use case. They seem to have pages that use the same layout and don't share data between themselves: https://developer.android.com/guide/navigation/navigation-swipe-view-2
Since ViewPager2 is completely new I decided to post a Stackoverflow question right away due to the simple fact that I am positive that my use case is the most popular one and thus, there will be more people with the same question.
Summa summarum: How does one implement two Fragments - with independent layouts - that share data and are swipe views themselves by utilizing the new ViewPager2 library.