Search in sources :

Example 1 with DividerItemDecoration

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();
}
Also used : ReportAdapter(flying.grub.tamtime.adapter.ReportAdapter) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(flying.grub.tamtime.adapter.DividerItemDecoration) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) RecyclerView(android.support.v7.widget.RecyclerView)

Example 2 with DividerItemDecoration

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;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(flying.grub.tamtime.adapter.DividerItemDecoration) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) OneRouteAdapter(flying.grub.tamtime.adapter.OneRouteAdapter)

Example 3 with DividerItemDecoration

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

Example 4 with DividerItemDecoration

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;
}
Also used : AllLinesAdapter(flying.grub.tamtime.adapter.AllLinesAdapter) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(flying.grub.tamtime.adapter.DividerItemDecoration) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)4 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 RecyclerView (android.support.v7.widget.RecyclerView)4 View (android.view.View)4 DividerItemDecoration (flying.grub.tamtime.adapter.DividerItemDecoration)4 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)1 SearchView (android.support.v7.widget.SearchView)1 TextView (android.widget.TextView)1 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)1 AllLinesAdapter (flying.grub.tamtime.adapter.AllLinesAdapter)1 AllStopAdapter (flying.grub.tamtime.adapter.AllStopAdapter)1 OneRouteAdapter (flying.grub.tamtime.adapter.OneRouteAdapter)1 ReportAdapter (flying.grub.tamtime.adapter.ReportAdapter)1