use of android.support.v7.widget.RecyclerView in project MultiType by drakeet.
the class MultiSelectActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_multi_select);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
final GridLayoutManager layoutManager = new GridLayoutManager(this, SPAN_COUNT);
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return (items.get(position) instanceof Category) ? SPAN_COUNT : 1;
}
});
selectedSet = new TreeSet<>();
recyclerView.setLayoutManager(layoutManager);
adapter = new MultiTypeAdapter();
adapter.applyGlobalMultiTypePool();
adapter.register(Square.class, new SquareViewBinder(selectedSet));
loadData();
assertAllRegistered(adapter, items);
recyclerView.setAdapter(adapter);
setupFAB();
}
use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
pager = (RecyclerView) findViewById(R.id.pager);
pager.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
snapperCarr.attachToRecyclerView(pager);
if (savedInstanceState != null) {
pickedDocument = savedInstanceState.getParcelable(STATE_PICKED);
if (pickedDocument != null) {
show(pickedDocument);
}
}
}
use of android.support.v7.widget.RecyclerView in project photo-picker-plus-android by chute.
the class FragmentRoot method initView.
private void initView(View view) {
recyclerView = (RecyclerView) view.findViewById(R.id.gcRecyclerViewAssets);
recyclerView.setHasFixedSize(true);
if (displayType == DisplayType.LIST && filterType == PhotoFilterType.SOCIAL_MEDIA) {
final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(linearLayoutManager);
} else {
final GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), getResources().getInteger(R.integer.grid_columns_assets));
recyclerView.setLayoutManager(gridLayoutManager);
}
progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
}
use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.
the class RecyclerViewActivity method getRecyclerView.
public RecyclerView getRecyclerView() {
if (rv == null) {
rv = new RecyclerView(this);
rv.setHasFixedSize(true);
setContentView(rv);
}
return (rv);
}
use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.
the class RecyclerViewActivity method getRecyclerView.
public RecyclerView getRecyclerView() {
if (rv == null) {
rv = new RecyclerView(this);
setContentView(rv);
}
return (rv);
}
Aggregations