I'm in the process of writing an app using Flow and Mortar. I'm having trouble figuring out how to use this when it comes to a view pager with tabs.
Only way I can think of is to treat the ViewPager screen as a single screen, and end up using Fragments to build it. But the whole point of using Flow & Mortar is to get rid of Fragments and simplify the lifecycle.
Any help is appreciated. Thanks.
The most common use of Flow is to trigger notifications. When a new lead is added to Microsoft Dynamics CRM, for example, an automated workflow can send sales representatives an email or text message with details about the lead. Flow can also be used to copy files.
Microsoft itself defines Flow as a tool to create automated workflows between your favourite apps and services to get notifications, synchronise files, collect data and more. Microsoft Flow is available bundled in some Office 365 licenses but also on a separate subscription-basis.
I made a view pager example, up to date with Mortar and Flow versions (based on adapter from Kirill Boyarshinov).
I don't copy past the code in the answer, because it's too big and it would be less readable (if it breaks the SO rules, let me know and I'll edit the answer).
View pager adapter : https://github.com/lukaspili/Mortar-Flow-Dagger2-demo/blob/master/app/src/main/java/com/lukaspili/mortardemo/app/adapter/SlidePagerAdapter.java
Screen containing the viewpager : https://github.com/lukaspili/Mortar-Flow-Dagger2-demo/blob/master/app/src/main/java/com/lukaspili/mortardemo/ui/screen/SlidesScreen.java
Screen as page of the viewpager : https://github.com/lukaspili/Mortar-Flow-Dagger2-demo/blob/master/app/src/main/java/com/lukaspili/mortardemo/ui/screen/SlidePageScreen.java
I think PagerAdapter is what you looking for. It used to bind View directly to the ViewPager with out using fragments by overriding instantiateItem(ViewGroup, int)
. and ViewGroup is an instance of ViewPager where you can use add method to add View to it directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With