artem-zinnatullin / RxUi

Implementation of pure functional concept of talking to Android View layer in a Reactive way
https://artemzin.com/blog/rxui-talking-to-android-view-layer-in-a-reactive-way/
MIT License
261 stars 22 forks source link

Google databinding with RxUI #26

Closed ghost closed 7 years ago

ghost commented 8 years ago

Hi, I use google databinding and i need a way to communicate with activity/fragment(not xml) from viewmodel. Is this library an good solution for communicating? Thanks!

artem-zinnatullin commented 8 years ago

If you don't share knowledge about Google's databinding to ViewModels — then yes, RxUi is good solution to talking between ViewModel and View layer.

On Mon, 11 Jul 2016, 16:35 Ungureanu Vasile, notifications@github.com wrote:

Hi, I use google databinding and i need a way to communicate/send commands with/to activity/fragment(not xml) from viewmodel. Is this library an good solution for communication/send commands? Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/artem-zinnatullin/RxUi/issues/26, or mute the thread https://github.com/notifications/unsubscribe/AA7B3CMktMSgG7WDDz1pmulIuZhNMqG5ks5qUkaGgaJpZM4JJXmv .

ghost commented 8 years ago

"If you don't share knowledge about Google's databinding to ViewModels" - im not shure that i understand this ))

P.S. I mean that in view model to use observable fields to bind xml properties (like text, visibility, image etc..) but with RxUi to bind (send commands) activity or fragment or view. Because in activity we initialize widgets like recycler view or spinners but in viewmodel we get data from repository and need to feed widgets adapters with them.

artem-zinnatullin commented 8 years ago

I mean if you use Observable types from Google's databinding it might be problem for integrating RxUi because it's an RxJava library.

Otherwise — I'd suggest to go and try to use RxUi and see how it works in your case. RxUi connects RxJava observables with UI layer, if you can represent your MVVM commands as RxJava Observables — then it should be perfect mix!

On Mon, 11 Jul 2016, 22:05 Ungureanu Vasile, notifications@github.com wrote:

"If you don't share knowledge about Google's databinding to ViewModels" - im not shure that i understand this ))

P.S. I mean that in view model to use observable fields to bind xml properties (like text, visibility, image etc..) but with RxUi to bind (send commands) activity or fragment or view.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/artem-zinnatullin/RxUi/issues/26#issuecomment-231832649, or mute the thread https://github.com/notifications/unsubscribe/AA7B3BgkUZnxVj0cZprC4G4BniXkpX2oks5qUpPogaJpZM4JJXmv .

artem-zinnatullin commented 7 years ago

I'm closing this, feel free to comment!