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

Two presenters and one user case: how can link them ? #291

Open
aeroxr1 opened this issue May 28, 2019 · 2 comments
Open

Two presenters and one user case: how can link them ? #291

aeroxr1 opened this issue May 28, 2019 · 2 comments

Comments

@aeroxr1
Copy link

aeroxr1 commented May 28, 2019

i have a fragment with two inner fragment. For the outside fragment I write a presenter with a user case "UserPressRedButton"

when the UserPressRedButton action is completed I have to update the presentation layer of the two inner fragment

In which way can link all together ?

@dharmendrainnovify
Copy link

@aeroxr1 I guess you can keep the references of the instances of the inner fragments in the outer fragment and simply call the public method to update the UI state. And if you want to access presenter in inner fragment then you can add inner fragments using ChildFragmentManager and then from inner fragment you can call getParentFragment() to access the public methods of parent fragment.

@aeroxr1
Copy link
Author

aeroxr1 commented May 28, 2019

I already done in that way, but i don't know if it is much clean.. In this way in the view there is some sort of business logic. It knows that he has to call update method on its inner fragments.
Currently I have only one presenter instance for outside and inner fragment and in inner fragment I call getParentFragment() to access the public method of presenter.
But in this way the view is too much dependent each other

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