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

[Question] Viewmodel with Databinding and ViewPager #54

Closed
daimonkor opened this issue Jun 8, 2017 · 1 comment
Closed

[Question] Viewmodel with Databinding and ViewPager #54

daimonkor opened this issue Jun 8, 2017 · 1 comment

Comments

@daimonkor
Copy link

daimonkor commented Jun 8, 2017

Please help, I have viewpager with fragments, databinding into viewmodel. Where I need use setCurrentItem and add functions of viewpager's adapter (view or viewmodel-databinding)? Is it necessary to create viewmodel for every viewpager's item?
Thanks for help.

@daimonkor daimonkor changed the title [QUESTION] Viewmodel with Databinding and ViewPager [Question] Viewmodel with Databinding and ViewPager Jun 8, 2017
@yigit
Copy link
Contributor

yigit commented Jun 25, 2017

It depends on your use case but it is probably good idea for each fragment to have its own view model.

@yigit yigit closed this as completed Jun 25, 2017
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