sockeqwe/mosby

Mosby V4 - AndroidX support

Open

#339 opened on Dec 27, 2019

View on GitHub
 (10 comments) (10 reactions) (0 assignees)Java (5,495 stars) (846 forks)batch import
help wanted

Description

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?

Contributor guide