@Test public void testSetRecyclerAdapter() { final Context context = RuntimeEnvironment.application; final RecyclerView recyclerView = new RecyclerView(context); assertNull(recyclerView.getAdapter()); final RecyclerView.Adapter<?> adapter = new RecyclerView.Adapter<RecyclerView.ViewHolder>() { @Override @NonNull public RecyclerView.ViewHolder onCreateViewHolder( @NonNull final ViewGroup parent, final int viewType) { return null; } @Override public void onBindViewHolder( @NonNull final RecyclerView.ViewHolder holder, final int position) { } @Override public int getItemCount() { return 0; } }; BindingAdapters.setRecyclerAdapter(recyclerView, adapter); assertEquals(adapter, recyclerView.getAdapter()); BindingAdapters.setRecyclerAdapter(recyclerView, null); assertNull(recyclerView.getAdapter()); }
@BindingAdapter("recyclerAdapter") public static void setRecyclerAdapter( @NonNull final RecyclerView recyclerView, @Nullable final RecyclerView.Adapter<?> adapter) { recyclerView.setAdapter(adapter); }
BindingAdapters { @BindingAdapter("recyclerAdapter") public static void setRecyclerAdapter( @NonNull final RecyclerView recyclerView, @Nullable final RecyclerView.Adapter<?> adapter) { recyclerView.setAdapter(adapter); } }
BindingAdapters { @BindingAdapter("recyclerAdapter") public static void setRecyclerAdapter( @NonNull final RecyclerView recyclerView, @Nullable final RecyclerView.Adapter<?> adapter) { recyclerView.setAdapter(adapter); } private  BindingAdapters(); }
BindingAdapters { @BindingAdapter("recyclerAdapter") public static void setRecyclerAdapter( @NonNull final RecyclerView recyclerView, @Nullable final RecyclerView.Adapter<?> adapter) { recyclerView.setAdapter(adapter); } private  BindingAdapters(); @NonNull static DataBindingComponent glideBindingComponent(
            @NonNull final RequestManager requestManager); @BindingAdapter("formattedDuration") static void setFormattedDuration(
            @NonNull final TextView textView,
            final long seconds); @BindingAdapter("recyclerAdapter") static void setRecyclerAdapter(
            @NonNull final RecyclerView recyclerView,
            @Nullable final RecyclerView.Adapter<?> adapter); @BindingAdapter({"drawableTop", "tintAttr"}) static void setDrawableTopTintedFromAttr(
            @NonNull final TextView textView,
            @Nullable Drawable top,
            @AttrRes final int tintAttr); @BindingAdapter({"srcRes", "tintAttr"}) static void setSrcResTintedFromAttr(
            @NonNull final ImageView imageView,
            @DrawableRes final int res,
            @AttrRes final int tintAttr); @BindingAdapter({"src", "tintAttr"}) static void setSrcTintedFromAttr(
            @NonNull final ImageView imageView,
            @Nullable Drawable src,
            @AttrRes final int tintAttr); @BindingAdapter({"src", "tintNormal", "useActivatedSrcTint"}) static void setUseActivatedSrcTint(
            @NonNull final ImageView imageView,
            @Nullable final Drawable src,
            @ColorInt final int tintNormal,
            final boolean useActivatedSrcTint); @BindingAdapter("activated") static void setActivated(@NonNull final View view, final boolean activated); @BindingAdapter("srcRes") static void setImageResource(
            @NonNull final ImageView imageView,
            @DrawableRes final int src); @BindingAdapter("colorFilter") static void setColorFiler(
            @NonNull final ImageView imageView,
            @ColorInt final int color); }
BindingAdapters { @BindingAdapter("recyclerAdapter") public static void setRecyclerAdapter( @NonNull final RecyclerView recyclerView, @Nullable final RecyclerView.Adapter<?> adapter) { recyclerView.setAdapter(adapter); } private  BindingAdapters(); @NonNull static DataBindingComponent glideBindingComponent(
            @NonNull final RequestManager requestManager); @BindingAdapter("formattedDuration") static void setFormattedDuration(
            @NonNull final TextView textView,
            final long seconds); @BindingAdapter("recyclerAdapter") static void setRecyclerAdapter(
            @NonNull final RecyclerView recyclerView,
            @Nullable final RecyclerView.Adapter<?> adapter); @BindingAdapter({"drawableTop", "tintAttr"}) static void setDrawableTopTintedFromAttr(
            @NonNull final TextView textView,
            @Nullable Drawable top,
            @AttrRes final int tintAttr); @BindingAdapter({"srcRes", "tintAttr"}) static void setSrcResTintedFromAttr(
            @NonNull final ImageView imageView,
            @DrawableRes final int res,
            @AttrRes final int tintAttr); @BindingAdapter({"src", "tintAttr"}) static void setSrcTintedFromAttr(
            @NonNull final ImageView imageView,
            @Nullable Drawable src,
            @AttrRes final int tintAttr); @BindingAdapter({"src", "tintNormal", "useActivatedSrcTint"}) static void setUseActivatedSrcTint(
            @NonNull final ImageView imageView,
            @Nullable final Drawable src,
            @ColorInt final int tintNormal,
            final boolean useActivatedSrcTint); @BindingAdapter("activated") static void setActivated(@NonNull final View view, final boolean activated); @BindingAdapter("srcRes") static void setImageResource(
            @NonNull final ImageView imageView,
            @DrawableRes final int src); @BindingAdapter("colorFilter") static void setColorFiler(
            @NonNull final ImageView imageView,
            @ColorInt final int color);  }