Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

把逻辑都放在fragment中有什么优势吗? #29

Closed
taozhixiang opened this issue Oct 21, 2019 · 2 comments
Closed

把逻辑都放在fragment中有什么优势吗? #29

taozhixiang opened this issue Oct 21, 2019 · 2 comments

Comments

@taozhixiang
Copy link

我看到项目里面所有的内容都写在了fragment中。就是登陆页面也是在activity中嵌套一个fragment。这么做事为什么呢?优势表现在哪些地方呢?

@qingmei2
Copy link
Owner

qingmei2 commented Nov 7, 2019

@taozhixiang

暂时没有很大的优势,我这样做的考虑可能是将来为 单Activity+多Fragment做准备,所有UI和业务逻辑都委托给Fragment,避免到时候的代码抽取,而Activity尽量只做一些导航类的行为。

@qingmei2
Copy link
Owner

qingmei2 commented Nov 7, 2019

Navigation是一个不错的库,是否尝试应用到正式的生产环境我其实还在观望中哈。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants