use of android.support.v7.widget.DividerItemDecoration in project YourAppIdea by Michenux.
the class AirportListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (BuildConfig.DEBUG) {
Log.i(YourApplication.LOG_TAG, "AirportListFragment.onCreateView");
}
View view = inflater.inflate(R.layout.airport_listfragment, container, false);
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.airport_swiperefreshlayout);
mSwipeRefreshLayout.setColorSchemeResources(R.color.refresh_progress_1, R.color.refresh_progress_2, R.color.refresh_progress_3);
mSwipeRefreshLayout.setOnRefreshListener(this);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.airport_recyclerview);
recyclerView.setHasFixedSize(true);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
linearLayoutManager.setOrientation(OrientationHelper.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), null));
recyclerView.setAdapter(this.mAirportAdapter);
return view;
}
use of android.support.v7.widget.DividerItemDecoration in project YourAppIdea by Michenux.
the class TutorialListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.tutorial_list, container, false);
// SwipeRefresh layout
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.tutorial_swiperefreshlayout);
mSwipeRefreshLayout.setOnRefreshListener(this);
mSwipeRefreshLayout.setColorSchemeResources(R.color.refresh_progress_1, R.color.refresh_progress_2, R.color.refresh_progress_3);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.tutorial_listview);
recyclerView.setHasFixedSize(true);
recyclerView.setLongClickable(false);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
linearLayoutManager.setOrientation(OrientationHelper.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), null));
ItemClickSupport.addTo(recyclerView).setOnItemClickListener(this);
this.getLoaderManager().initLoader(0, null, this);
this.mAdapter = new TutorialRecyclerAdapter();
recyclerView.setAdapter(this.mAdapter);
return view;
}
use of android.support.v7.widget.DividerItemDecoration in project Remindy by abicelis.
the class TaskFragment method setUpRecyclerView.
private void setUpRecyclerView() {
mLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
mAdapter = new AttachmentAdapter(getActivity(), mTask.getAttachments(), false);
mAdapter.setShowAttachmentHintListener(new AttachmentAdapter.ShowAttachmentHintListener() {
@Override
public void onShowAttachmentHint() {
if (!mAttachmentLongClickOptionsDialogHintShown) {
mAttachmentLongClickOptionsDialogHintShown = true;
SnackbarUtil.showSnackbar(mContainer, SnackbarUtil.SnackbarType.NOTICE, R.string.fragment_task_snackbar_notice_attachments_options_hint, SnackbarUtil.SnackbarDuration.LONG, null);
}
}
});
DividerItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), mLayoutManager.getOrientation());
itemDecoration.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.item_decoration_half_line));
mRecyclerView.setNestedScrollingEnabled(false);
mRecyclerView.addItemDecoration(itemDecoration);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mAdapter);
}
use of android.support.v7.widget.DividerItemDecoration in project Tusky by Vavassor.
the class AccountListFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_account_list, container, false);
Context context = getContext();
recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(context);
recyclerView.setLayoutManager(layoutManager);
DividerItemDecoration divider = new DividerItemDecoration(context, layoutManager.getOrientation());
Drawable drawable = ThemeUtils.getDrawable(context, R.attr.status_divider_drawable, R.drawable.status_divider_dark);
divider.setDrawable(drawable);
recyclerView.addItemDecoration(divider);
scrollListener = null;
if (type == Type.BLOCKS) {
adapter = new BlocksAdapter(this);
} else if (type == Type.MUTES) {
adapter = new MutesAdapter(this);
} else if (type == Type.FOLLOW_REQUESTS) {
adapter = new FollowRequestsAdapter(this);
} else {
adapter = new FollowAdapter(this);
}
recyclerView.setAdapter(adapter);
return rootView;
}
use of android.support.v7.widget.DividerItemDecoration in project bdcodehelper by boredream.
the class MultiPageLoadPresent method initView.
private void initView() {
srl.setColorSchemeColors(activity.getResources().getColor(R.color.colorPrimary));
rv = (RecyclerView) srl.findViewById(R.id.rv);
LinearLayoutManager layoutManager = new LinearLayoutManager(activity, StaggeredGridLayoutManager.VERTICAL, false);
rv.setLayoutManager(layoutManager);
itemDecoration = new DividerItemDecoration(activity);
rv.addItemDecoration(itemDecoration);
}
Aggregations