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

Add androidx support #317

Closed Jeff11 closed 6 years ago

Jeff11 commented 6 years ago

We get Unresolved reference because android.support.v7.app.AppCompatActivity is not recognized when using androidx.

sockeqwe commented 6 years ago

Unfortunately we are in a bad situation with all this androidx package renaming. I can't update Mosby to androidx without breaking other apps.

However, what you can do is write your own class BaseActvitiy extends androidx.appcompat.app.AppCompatActivity and then just use the Mosby internal deleage.

Basically you just have to copy & paste the Mosby internal classes https://github.com/sockeqwe/mosby/blob/master/mvp/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpActivity.java

which actually then just delegates / forwards lifecycle events to the corresponding delegate.