Skip to content

Solution using Data Binding & MVVM#1

Open
manas-chaudhari wants to merge 6 commits intosolutionfrom
solution-mvvm
Open

Solution using Data Binding & MVVM#1
manas-chaudhari wants to merge 6 commits intosolutionfrom
solution-mvvm

Conversation

@manas-chaudhari
Copy link
Owner

No description provided.

import static com.manaschaudhari.android_mvvm.FieldUtils.toObservable;

public class MainViewModel implements ViewModel {
public final Observable<List<ViewModel>> repositories;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be of type Observable<List<GithubRepoVM>>?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I had some problems making Observable<List<VMSubclass>> work, as Data Binding does not support generics in @BindingAdapter methods. Hence, this isn't supported in the first release.

Recently, I found that generics can be used in @BindingConversion. As soon as I release the next version, I'll update this.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants