Search in sources :

Example 1 with DividerItemDecoration

use of org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration in project YourAppIdea by Michenux.

the class CityListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.city_fragment, container, false);
    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.city_listview);
    recyclerView.setHasFixedSize(true);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
    linearLayoutManager.setOrientation(OrientationHelper.VERTICAL);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), null));
    recyclerView.setAdapter(this.mAdapter);
    ItemClickSupport.addTo(recyclerView).setOnItemClickListener(this);
    return view;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 2 with DividerItemDecoration

use of org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration in project YourAppIdea by Michenux.

the class FriendListFragment method onCreateView.

/**
     * {@inheritDoc}
     *
     * @see android.support.v4.app.ListFragment#onCreateView(android.view.LayoutInflater,
     * android.view.ViewGroup, android.os.Bundle)
     */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View mainView = inflater.inflate(R.layout.friendlist, container, false);
    mRecyclerView = (RecyclerView) mainView.findViewById(R.id.friend_recyclerview);
    mRecyclerView.setHasFixedSize(true);
    mRecyclerView.setLongClickable(false);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
    linearLayoutManager.setOrientation(OrientationHelper.VERTICAL);
    mRecyclerView.setLayoutManager(linearLayoutManager);
    mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), null));
    ItemClickSupport.addTo(mRecyclerView).setOnItemClickListener(this);
    fillData();
    return mainView;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 3 with DividerItemDecoration

use of org.michenux.drodrolib.ui.recyclerview.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;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration) View(android.view.View) AdapterView(android.widget.AdapterView) RecyclerView(android.support.v7.widget.RecyclerView)

Example 4 with DividerItemDecoration

use of org.michenux.drodrolib.ui.recyclerview.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;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 RecyclerView (android.support.v7.widget.RecyclerView)4 View (android.view.View)4 DividerItemDecoration (org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration)4 AdapterView (android.widget.AdapterView)1