dimanche 26 août 2018

MVP to MVVM Android

One guy from here told me that MVVM is better than MVP he told me many pros and many conts, but I'd like to know if my MVP is well done or if you know any other way maybe to convert to MVVM. It's a Sign in with Google MVP. I won't put all of the code but I'll put the folders and little explanation :

-Model

  • User (Simple user pojo class)

-Presenter

  • I have an object of my IGoogleLoginView where I call the methods, but here I have the logic createGoogleClient(),signIn(),onActivityResult(),onStop(), onStart(), onDestroy() all of those methods are from my interface inside the same package IGoogleSignIn
  • IGoogleSignIn - All of the methods from the Presenter class

-View

  • googleSignIn()
  • goToMainActivity()

And then I have my MainActivity where I call the methods...

I'm wondering how different could be to do that on MVVM and what would be the changes to do it, and also is something that it's not on the good place?

Aucun commentaire:

Enregistrer un commentaire