NextFaze / power-adapters

Composable adapters for Android RecyclerViews and ListViews
Apache License 2.0
108 stars 13 forks source link

Simplify GridListAdapter instantiation #6

Closed bemusementpark closed 8 years ago

bemusementpark commented 8 years ago

Frequently code of this form is coming up:

PowerAdapter wrappedAdapter = ...;
GridListAdapter gridAdapter = new GridListAdapter(wrappedAdapter);
gridAdapter.applyStyle(getContext(), R.style.GridStyle);
wrappedAdapter = gridAdapter;

A constructor (or factory method) that takes a style and context could simplify usage, and allow removal of the GridListAdapter variable. e.g.

PowerAdapter wrappedAdapter = ...;
wrappedAdapter = new GridListAdapter(wrappedAdapter,getContext(), R.style.GridStyle);