使用流和放大器;砂浆ViewPager [英] Using Flow & Mortar with ViewPager

查看:158
本文介绍了使用流和放大器;砂浆ViewPager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写使用流量和砂浆的应用程序的过程。我无法搞清楚如何使用这个当谈到与标签视图寻呼机。

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.

我唯一能想到的办法是治疗ViewPager屏幕单屏,并最终利用片段来构建它。但是,使用流量和放大器的整点;砂浆是摆脱碎片和简化的生命周期。

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.

任何帮助是AP preciated。谢谢你。

Any help is appreciated. Thanks.

推荐答案

我做了一个观点寻呼机例如,了解最新的砂浆和流量版本(基于适配器从基里尔Boyarshinov)。结果
我不抄过去code的答案,因为它太大了,它会少可读(如果它打破了SO规则,让我知道,我会编辑的答案)。

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).

查看传呼机适配器: https://github.com/lukaspili/Mortar-Flow-Dagger2-demo/blob/master/app/src/main/java/com/lukaspili/mortardemo/app/adapter/SlidePagerAdapter.java

包含viewpager的屏幕: https://github.com/lukaspili/Mortar-Flow-Dagger2-demo/blob/master/app/src/main/java/com/lukaspili/mortardemo/ui/screen/SlidesScreen.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

屏作为viewpager的页面: https://github.com/lukaspili/Mortar-Flow-Dagger2-demo/blob/master/app/src/main/java/com/lukaspili/mortardemo/ui/screen/SlidePageScreen.java

这篇关于使用流和放大器;砂浆ViewPager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆