use of flying.grub.tamtime.adapter.DividerItemDecoration in project TamTime by flyingrub.
the class OneStopActivity method createAllReportDialog.
private void createAllReportDialog() {
String title = getBaseContext().getResources().getQuantityString(R.plurals.report, stop.getReports().size());
current_dialog = new MaterialDialog.Builder(this).title(title).customView(R.layout.view_recycler, false).positiveText(R.string.OK).build();
View view = current_dialog.getCustomView();
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
recyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new org.solovyev.android.views.llm.LinearLayoutManager(getBaseContext(), LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getBaseContext());
recyclerView.addItemDecoration(itemDecoration);
ReportAdapter adapter = new ReportAdapter(stop.getReports(), getBaseContext());
recyclerView.setAdapter(adapter);
adapter.SetOnItemClickListener(new ReportAdapter.OnItemClickListener() {
@Override
public void onItemClick(View v, int position) {
confirmDialog(position);
}
});
current_dialog.show();
}
use of flying.grub.tamtime.adapter.DividerItemDecoration in project TamTime by flyingrub.
the class LineRouteFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.view_swype_refresh, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.my_recycler_view);
circularIndeterminate = (ProgressBarCircularIndeterminate) view.findViewById(R.id.progressBarCircularIndeterminate);
refreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh_layout);
recyclerView.setHasFixedSize(true);
layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity());
recyclerView.addItemDecoration(itemDecoration);
direction = Data.getData().getMap().getLine(linePosition).getDirections().get(routePosition);
adapter = new OneRouteAdapter(direction.getStops(), getContext(), isTheoritical);
recyclerView.setAdapter(adapter);
adapter.SetOnItemClickListener(new OneRouteAdapter.OnItemClickListener() {
@Override
public void onItemClick(View v, int position) {
selectitem(position);
}
});
if (isTheoritical) {
getActivity().setTitle("Théorique : Ligne " + Data.getData().getMap().getLine(linePosition).getShortName());
} else {
getActivity().setTitle("Ligne " + Data.getData().getMap().getLine(linePosition).getShortName());
}
circularIndeterminate.setVisibility(View.GONE);
refreshLayout.setVisibility(View.VISIBLE);
refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Data.getData().update();
}
});
refreshLayout.setColorSchemeResources(R.color.primaryColor);
setHasOptionsMenu(true);
return view;
}
use of flying.grub.tamtime.adapter.DividerItemDecoration 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;
}
use of flying.grub.tamtime.adapter.DividerItemDecoration in project TamTime by flyingrub.
the class AllLinesFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.view_recycler, container, false);
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(true);
layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
getActivity().setTitle(getString(R.string.all_lines));
RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity());
recyclerView.addItemDecoration(itemDecoration);
// specify an adapter (see also next example)
lines = Data.getData().getMap().getLines();
adapter = new AllLinesAdapter(lines);
recyclerView.setAdapter(adapter);
adapter.SetOnItemClickListener(new AllLinesAdapter.OnItemClickListener() {
@Override
public void onItemClick(View v, int position) {
selectitem(position);
}
});
return view;
}
Aggregations