konmik / nucleus

Nucleus is an Android library, which utilizes the Model-View-Presenter pattern to properly connect background tasks with visual parts of an application.
MIT License
1.97k stars 253 forks source link

Initial work for rxjava2 support (additional contrubution welcome) #122

Closed jakubvimn closed 7 years ago

jakubvimn commented 7 years ago

This PR is the first step for the support for RxJava2, as requested in issue #111 I've done all the stupid work of making project compile with the new library version. Currently not all tests pass, so the job is not done. I hope that @konmik, or someone else will continue with fixing the tests. It should be much easier now than starting from scratch. Unfortunately, I probably won't have time to do it myself.

I've introduced the class SilentCallable to have something like Func0 from RxJava 1.x, which doesn't throw an exception. Alternatively, a Callable could be used, but that would require adding more logic for checked exceptions handling. I'm not sure which way is better.

konmik commented 7 years ago

I finally took my look into this pull request. The result does not work because "Null values are generally not allowed in 2.x operators and sources" and we're passing view() as a view instance OR null.

We need to create a workaround by passing something weird OR we need to comply with RxJava 2.0 standards.

For now I have no idea how to do it properly. Any though?

jakubvimn commented 7 years ago

I didn't have time for making a deep analysis, what are the null values actually used for, but I guess that they are some kind of markers that the recently received object is no longer valid. The options for eliminating nulls that I see are: