Open VashchenkoAndrey opened 4 years ago
Hello.
There are several ways to tackle this problem.
If you have DI in your project, you can bind your main fragment's presenter to be a singleton in the scope of the main fragment, and then get it from that scope inside your pager fragments. An implementation may vary depending on the DI framework you use.
Another way I can think of is to crawl from viewpager fragments up the parent fragments until you find your main fragment and get presenter from the main fragment instance directly. You can refer to AndroidInjection and NavHostFragment for samples of parent fragment crawling.
Hello. Could you help me please? I use Single Activity Architecture. I have a fragment with ViewPager. How to make the main fragment and view pager fragments served by one presenter? Thank you