UPDATE: Remove binding attribute "layout_manager" of RecyclerView, since the automatic binding attribute "layoutManager" is sufficient.

This commit is contained in:
Oasis 2017-01-17 01:39:01 +08:00
parent cd20f631c1
commit 31d5757c9e

View File

@ -13,11 +13,6 @@ import android.support.v7.widget.RecyclerView;
@SuppressWarnings("unused")
public class RecyclerViewBindingAdapter {
@BindingAdapter("layout_manager")
public static <T> void setItemsAndBinder(final RecyclerView recycler_view, final RecyclerView.LayoutManager manager) {
recycler_view.setLayoutManager(manager);
}
@BindingAdapter({"items", "item_binder", "item_layout_selector"})
public static <T> void setItemsAndBinder(final RecyclerView recycler_view, final ObservableList<T> items, final ItemBinder<T> binder, final LayoutSelector<T> layout_selector) {
recycler_view.setAdapter(new BindingRecyclerViewAdapter<>(items, binder, layout_selector));