Moviper icon indicating copy to clipboard operation
Moviper copied to clipboard

Sample case when using a view you cannot extend (e.g. DialogFragment)

Open elprl opened this issue 7 years ago • 2 comments

What do you recommend doing when you cannot extend ViperFragment or ViperActivity? Let's say I have a custom view that already extends DialogFragment, what's the approach to rigging up / binding the presenter, interactor, router? I can't seem to find a suitable sample that fits this need.

elprl avatar Aug 04 '17 19:08 elprl

In the regular case I just try to attach Moviper internals to the given element. Actually, we do use DialogFragment with Moviper in our projects, but we haven't yet pushed and released appropriate classes. I'll do it in few days.

If it's not your case, just try to rewrite the root of the flavor you use, ie if you use the ViperAiPassive flavor, follow its inheritance chain (on the example of a Fragment):

ViperAiPassiveFragment -> ViperAiFragment -> MvpAiFragment -> Fragment

and try to rewrite it using another base class, ie DialogFragment instead of Fragment, but as I said, you don't need to do it if you need DialogFragment - I'll release it very soon.

mkoslacz avatar Aug 07 '17 08:08 mkoslacz

Well, obviously I have not pushed that to the project, but I will consider adding that to the upcoming Moviper 3.0. I'm not closing the issue as it's not fixed yet.

mkoslacz avatar Oct 09 '18 17:10 mkoslacz