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;
}
Aggregations