use of android.support.v7.widget.GridLayoutManager 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.GridLayoutManager in project kickmaterial by byoutline.
the class ProjectsListFragment method setUpAdapters.
private void setUpAdapters() {
/** NEW ADAPTER **/
layoutManager = new GridLayoutManager(getActivity(), 2);
final boolean showHeader = sharedPreferences.getBoolean(PREFS_SHOW_HEADER, true);
// TODO: decide when to hide it.
sharedPreferences.edit().putBoolean(PREFS_SHOW_HEADER, false).apply();
final ProjectsAdapter.ItemViewTypeProvider itemViewTypeProvider = new ProjectsAdapter.ItemViewTypeProvider(showHeader);
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
if (itemViewTypeProvider.getViewType(position) == ProjectsAdapter.NORMAL_ITEM) {
return 1;
}
return 2;
}
});
projectListRv.setEndlessScrollListener(this);
projectListRv.setLayoutManager(layoutManager);
adapter = new ProjectsAdapter(getActivity(), this, showHeader, itemViewTypeProvider);
projectListRv.setAdapter(adapter);
}
use of android.support.v7.widget.GridLayoutManager in project PhotoView by chrisbanes.
the class ActivityTransitionActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_transition);
RecyclerView list = (RecyclerView) findViewById(R.id.list);
list.setLayoutManager(new GridLayoutManager(this, 2));
ImageAdapter imageAdapter = new ImageAdapter(new ImageAdapter.Listener() {
@Override
public void onImageClicked(View view) {
transition(view);
}
});
list.setAdapter(imageAdapter);
}
use of android.support.v7.widget.GridLayoutManager in project philm by chrisbanes.
the class MovieDetailFragment method populateUi.
private void populateUi() {
if (mMovie == null) {
return;
}
if (mBackdropImageView != null) {
if (mMovie.hasBackdropUrl()) {
mBackdropImageView.loadBackdrop(mMovie);
}
}
if (mCollapsingToolbarLayout != null) {
mCollapsingToolbarLayout.setTitle(mMovie.getTitle());
}
mAdapter = new GroupAdapter();
mAdapter.add(new TitleItem());
mAdapter.add(new ButtonsItem());
if (!TextUtils.isEmpty(mMovie.getOverview())) {
mAdapter.add(new SummaryItem());
}
mAdapter.add(new RatingItem());
mAdapter.add(new DetailsGroup());
//
// if (!PhilmCollections.isEmpty(mMovie.getTrailers())) {
// mItems.add(DetailItemType.TRAILERS);
// }
//
// if (!PhilmCollections.isEmpty(mMovie.getCast())) {
// mItems.add(DetailItemType.CAST);
// }
//
// if (!PhilmCollections.isEmpty(mMovie.getCrew())) {
// mItems.add(DetailItemType.CREW);
// }
//
// if (!PhilmCollections.isEmpty(mMovie.getRelated())) {
// mItems.add(DetailItemType.RELATED);
// }
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), mAdapter.getSpanCount());
layoutManager.setSpanSizeLookup(mAdapter.getSpanSizeLookup());
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setAdapter(mAdapter);
}
use of android.support.v7.widget.GridLayoutManager in project UltimateRecyclerView by cymcsg.
the class catelogGrid method renderviewlayout.
protected void renderviewlayout(View view) throws Exception {
listview_layout = (UltimateRecyclerView) view.findViewById(getUltimate_recycler_viewResId());
listview_layout.setHasFixedSize(true);
listview_layout.setSaveEnabled(true);
if (mLayoutManager == null) {
mLayoutManager = new GridLayoutManager(view.getContext(), getColumn(), LinearLayoutManager.VERTICAL, false);
}
listview_layout.setLayoutManager(mLayoutManager);
getProgressbar(view);
listview_layout.setAdapter(madapter = getAdatperWithdata());
setUltimateRecyclerViewExtra(listview_layout, madapter);
}
Aggregations