use of flying.grub.tamtime.adapter.ReportAdapter in project TamTime by flyingrub.
the class OneStopActivity method updateAllReportDialog.
private void updateAllReportDialog() {
if (current_dialog != null && current_dialog.isShowing()) {
View view = current_dialog.getCustomView();
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
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);
}
});
}
}
use of flying.grub.tamtime.adapter.ReportAdapter 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();
}
Aggregations