There is a fragment of А , which has its own presenter.

On this fragment А , a custom dialog Б launched in which there is an EditText and a button.

When we click on the button in EditText some text is inserted, which needs to be returned back to the fragment А

Question: how many presenters are needed here?

2: one for the dialogue, to follow the text and set it in EditText and the second for the fragment to launch this dialogue and perform other operations on the main View. Or 1 to do it all together and immediately? How to do better here?

    1 answer 1

    Only you can give an exact answer to your question.

    It is architecturally dependent. Those. how you do it will be.

    It is better to use one presenter or two - only you know.

    I would use one. But again - I am not aware of everything that you want to realize.

    Ps read / google about best practices and the like.

    • Yes, I understand that everything depends on how I decide myself, but can you argue why 1 presenter is better than 2 in your opinion? Read-googled, but something I just can not form my opinion - whalemare
    • @whalemare, nothing personal, honestly, but: the answer to your question is "because I like it so much" because I do not see the real problem. if your task is simply to transfer text from text to activations - why do you need to preschers and everything else? Advice - read about the goals of MVP. Answer the questions to yourself: "Why use MVP? What will it give me if I use the MVP pattern? Do I need it here?" - researcher
    • No, the task is much more complicated, I just simplified it in this context, I understood you. - whalemare
    • @whalemare then you need to understand that in your task to solve the use / application of the MVP pattern. To understand this you need to read about the goals and the need to apply this pattern. (a few words offhand: simplifying testing, sharing responsibility) - researcher
    • one
      @whalemare look at this tutorial from google - researcher