use of com.thebluealliance.androidclient.DividerItemDecoration in project the-blue-alliance-android by the-blue-alliance.
the class RecyclerViewFragment method onCreateView.
@Override
@Nullable
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v;
// to do it programmatically.
if (shouldShowScrollbars()) {
v = inflater.inflate(R.layout.recycler_view_with_spinner, null);
} else {
v = inflater.inflate(R.layout.recycler_view_with_spinner_no_scrollbar, null);
}
mBinder.setRootView(v);
mBinder.setRecyclerViewBinderMapper(this);
mRecyclerView = (RecyclerView) v.findViewById(R.id.list);
mRecyclerView.setHasFixedSize(true);
if (shouldShowDividers()) {
mRecyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL_LIST));
}
mLayoutManager = new LinearLayoutManager(getContext());
mRecyclerView.setLayoutManager(mLayoutManager);
ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.progress);
if (mAdapter != null) {
mRecyclerView.setAdapter(mAdapter);
mLayoutManager.onRestoreInstanceState(mListState);
progressBar.setVisibility(View.GONE);
}
mBinder.setNoDataView((NoDataView) v.findViewById(R.id.no_data));
return v;
}
Aggregations