sockeqwe / mosby

A Model-View-Presenter / Model-View-Intent library for modern Android apps
http://hannesdorfmann.com/mosby/
Apache License 2.0
5.49k stars 841 forks source link

Mosby V4 - AndroidX support #339

Open sockeqwe opened 4 years ago

sockeqwe commented 4 years ago

Unfortunately Mosby V3 is not compatable with AndroidX as accessing the backstack to see if a fragment is still in use (or presenter can be released) is not possible anymore in androidx as the method to get this information is "blacklisted" and no accessible from the outside anymore (it was in support.v4 days) see #338 #336

Any workaround suggested in #338 seems to me fragile. Therefore I considering the following: What we actually need is a lifecycle callback that tells us when the Fragment is actually destroyed. We could get this information by using AndroidX ViewModel,onCleared().

This will not be breaking change, rather it's a minor implementation detail under the hood.

What do you think?

mseroczynski commented 4 years ago

For me it's "whatever works" as long as I can keep updating critically important dependencies, have you tried this approach? @sockeqwe Is there any v4 release ETA...?

atetc commented 4 years ago

It would be fair if this important notice will appear in https://github.com/sockeqwe/mosby/blob/master/README.md

HowardSchmaeu commented 3 years ago

hi, is there any Progress in the AndroidX Development? It would nice to use your great lib also in AndroidX... also after Jake now has deprecated the ButterKnife... Plz let us know what your plans are :-)

sockeqwe commented 3 years ago

I will dedicate some time towards end of September to do the update to androidx and add official support for it but most likely this will be the last major release and will go similar direction as Butterknife did by deprecating Mosby.

HowardSchmaeu notifications@github.com schrieb am Di., 4. Aug. 2020, 15:25:

hi, is there any Progress in the AndroidX Development? It would nice to use your great lib also in AndroidX... also after Jake now has deprecated the ButterKnife... Plz let us know what your plans are :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sockeqwe/mosby/issues/339#issuecomment-668595101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEOPLXKAYMYKIKK2VL3RALR7AD3PANCNFSM4KABHD2Q .

HowardSchmaeu commented 3 years ago

Hey nice to hear that you work on it. But bad news because of the deprecation :-(

sockeqwe commented 3 years ago

Deprecation doesn't mean stop working not minor big fixes, just don't expect bigger releases

HowardSchmaeu notifications@github.com schrieb am Mo., 10. Aug. 2020, 10:52:

Hey nice to hear that you work on it. But bad news because of the deprecation :-(

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sockeqwe/mosby/issues/339#issuecomment-671236994, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEOPLWSP7ZG2ZJBAUTTRJTR76YNVANCNFSM4KABHD2Q .

maestrovsmaster commented 3 years ago

after update mosby to latest version, the method createPresenter called before onCreateView method of fragment, so i can not pass bundle parameters to presenter for creating initial state =( Old order:

  1. first call onCreateView (and we can receive bundle params)
  2. second called override method createPresenter (we can pass initial params to presenter method initialModelSingle)

After mosby update

  1. first call method createPresenter (and we have not bundle initial params yet)
  2. second called override method createPresenter Why changed methods calling order?
HowardSchmaeu commented 3 years ago

Deprecation doesn't mean stop working not minor big fixes, just don't expect bigger releases > .

Okay great... but did you think you can create a new version of all without Butterknife? I thought this is deep chained in Mosby??

DanielNovak commented 3 years ago

Any news? Thank you.

Evgeniy-Sh commented 3 years ago

Hi! Tell me please the release date of Mosby v4?