Manas Chaudhari

Results 25 comments of Manas Chaudhari
trafficstars

I am not sure about this approach as of now. Extracting the logic of `MvvmActivity` into a separate class is a great idea as it encourages composition instead of inheritance....

You can use the `FieldUtils.toObservable` inside the extension function. The code doesn't need to be repeated. ``` fun ObservableField.toObservable(): Observable = FieldUtils.toObservable(this) ```

I like to keep the unit tests of ViewModels simple without Rx dependencies. ```java LoginViewModel loginViewModel = new LoginViewModel(); loginViewModel.email.set("invalid@invalid"); assertEquals("Invalid email", loginViewModel.emailError.get()); ``` However, the dependent values (`emailError` in...

This is a great idea. It would also enable building an adapter that creates animates the changes in RecyclerView. I think `ReactiveList` implementation should be a separate library. If there...

There are few issues that will come up if `RecyclerViewAdapter` argument is changed to `databinding.ObservableList`. The type in BindingAdapter would also change to `ObservableList`. ```java public void bindAdapter(RecyclerView, ObservableList, ViewProvider...

This article https://medium.com/google-developers/android-data-binding-list-tricks-ef3d5630555e#.x3q5qels4 uses approach 1. ``` @BindingAdapter({"entries", "layout"}) public static void setEntries(ViewGroup viewGroup, ObservableList oldEntries, int oldLayoutId, ObservableList newEntries, int newLayoutId) { if (oldEntries == newEntries && oldLayoutId ==...

@vinayppatil1989 You're right. VM shouldn't be aware about `layoutId`. You can pass an interface to the View similar to `Navigator` in the sample and perform the fragment transaction in its...

Yes, it would. But, I think its necessary if you have different parameters for different navigations. If you have common arguments for navigation, you can pass the information as a...

Problem is that that would couple your layout to the ViewModel. Hence, you won't be able to use the same ViewModel with another layout.

No update on this. You can implement this through a `BindingAdapter`. It should roughly look like this: ```java public static void bindLifecycle(View view, Connectable connectable) { if (connectable != null)...