@Test public void testSetAdapter() { assertNull(mRecyclerView.getAdapter()); RecyclerMixin mixin = new RecyclerMixin(mTemplateLayout, mRecyclerView); mixin.setAdapter(mAdapter); assertSame(mAdapter, mRecyclerView.getAdapter()); }
public void setAdapter(Adapter<? extends ViewHolder> adapter) { mRecyclerView.setAdapter(adapter); }
RecyclerMixin implements Mixin { public void setAdapter(Adapter<? extends ViewHolder> adapter) { mRecyclerView.setAdapter(adapter); } }
RecyclerMixin implements Mixin { public void setAdapter(Adapter<? extends ViewHolder> adapter) { mRecyclerView.setAdapter(adapter); } RecyclerMixin(@NonNull TemplateLayout layout, @NonNull RecyclerView recyclerView); }
RecyclerMixin implements Mixin { public void setAdapter(Adapter<? extends ViewHolder> adapter) { mRecyclerView.setAdapter(adapter); } RecyclerMixin(@NonNull TemplateLayout layout, @NonNull RecyclerView recyclerView); void parseAttributes(@Nullable AttributeSet attrs, int defStyleAttr); @SuppressWarnings("NullableProblems") // If clients guarantee that the template has a recycler // view, and call this after the template is inflated, // this will not return null. RecyclerView getRecyclerView(); @SuppressWarnings("NullableProblems") // If clients guarantee that the template has a header, // this call will not return null. View getHeader(); void onLayout(); Adapter<? extends ViewHolder> getAdapter(); void setAdapter(Adapter<? extends ViewHolder> adapter); void setDividerInset(int inset); int getDividerInset(); Drawable getDivider(); void setDividerItemDecoration(@NonNull DividerItemDecoration decoration); }
RecyclerMixin implements Mixin { public void setAdapter(Adapter<? extends ViewHolder> adapter) { mRecyclerView.setAdapter(adapter); } RecyclerMixin(@NonNull TemplateLayout layout, @NonNull RecyclerView recyclerView); void parseAttributes(@Nullable AttributeSet attrs, int defStyleAttr); @SuppressWarnings("NullableProblems") // If clients guarantee that the template has a recycler // view, and call this after the template is inflated, // this will not return null. RecyclerView getRecyclerView(); @SuppressWarnings("NullableProblems") // If clients guarantee that the template has a header, // this call will not return null. View getHeader(); void onLayout(); Adapter<? extends ViewHolder> getAdapter(); void setAdapter(Adapter<? extends ViewHolder> adapter); void setDividerInset(int inset); int getDividerInset(); Drawable getDivider(); void setDividerItemDecoration(@NonNull DividerItemDecoration decoration);  }