Search in sources :

Example 1 with AllStopAdapter

use of flying.grub.tamtime.adapter.AllStopAdapter in project TamTime by flyingrub.

the class AllStopFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.view_recycler, container, false);
    setHasOptionsMenu(true);
    recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
    // use this setting to improve performance if you know that changes
    // in content do not change the layout size of the RecyclerView
    recyclerView.setHasFixedSize(false);
    layoutManager = new LinearLayoutManager(getActivity());
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    getActivity().setTitle(getString(R.string.all_stops));
    RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity());
    recyclerView.addItemDecoration(itemDecoration);
    currentDisplayedStop = Data.getData().getMap().getStopZones();
    adapter = new AllStopAdapter(currentDisplayedStop);
    recyclerView.setAdapter(adapter);
    adapter.SetOnItemClickListener(new AllStopAdapter.OnItemClickListener() {

        @Override
        public void onItemClick(View v, int position) {
            selectitem(position);
        }
    });
    return view;
}
Also used : AllStopAdapter(flying.grub.tamtime.adapter.AllStopAdapter) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(flying.grub.tamtime.adapter.DividerItemDecoration) SearchView(android.support.v7.widget.SearchView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SearchView (android.support.v7.widget.SearchView)1 View (android.view.View)1 TextView (android.widget.TextView)1 AllStopAdapter (flying.grub.tamtime.adapter.AllStopAdapter)1 DividerItemDecoration (flying.grub.tamtime.adapter.DividerItemDecoration)1