-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Variant with View Binding Support #322
Comments
PRs for this are welcome 👍 |
It is rather simple at first glance, Though needed opinion on how to name the classes: BindableItem -> ViewBindableItem? Also, in BindableItem @NonNull
@Override
public GroupieViewHolder<T> createViewHolder(@NonNull View itemView) {
T viewDataBinding = DataBindingUtil.bind(itemView);
return new GroupieViewHolder<>(viewDataBinding);
} DataBindingUtil is not available, so we will have to provide an abstract method to create new instance of T public abstract T initBinding(@NonNull View itemView);
@NonNull
@Override
public VBViewHolder<T> createViewHolder(@NonNull View itemView) {
T viewBinding = initBinding(itemView);
return new VBViewHolder<>(viewBinding);
} So the user will now have to provide implementation of 1 more method. Is this acceptable, or is there an alternate option? |
I like this idea @lkishor |
I'm open to reviewing a PR on this, though I don't like asking the user to provide one more method - would there be a way around this? I've not read too much into how Viewbinding works or how it's best used. |
Groupie's |
Now implemented in 2.8.0 - please give it and try and give feedback. Thanks again @nashcft |
Many thanks to @lisawray and the community to create and maintain this library.👏
Now that Android Studio 3.6 ships with ViewBinding. A annotation processing free option for generating Layout bindings.
It will be great to have an option to use Groupie with it.
I can put some effort and create a PR if needed.
The text was updated successfully, but these errors were encountered: