Search in sources :

Example 1 with TimetableAdapter

use of com.jakdor.labday.view.adapter.TimetableAdapter in project LabDayApp by jakdor.

the class TimetableFragment method loadRecyclerView.

/**
 * Load RecyclerView, and path info to bar
 * @param appData from repository
 * @param activePathId id of active Path
 */
private void loadRecyclerView(AppData appData, int activePathId) {
    for (Path path : appData.getPaths()) {
        if (path.getId() == activePathId) {
            binding.setTitle(path.getInfo());
            break;
        }
    }
    RecyclerView recyclerView = binding.timetableRecyclerView;
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
    linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(linearLayoutManager);
    TimetableAdapter timetableAdapter = new TimetableAdapter(this, appData, activePathId, GlideApp.with(this), getHeight());
    recyclerView.setAdapter(timetableAdapter);
    recyclerView.invalidate();
}
Also used : Path(com.jakdor.labday.common.model.Path) TimetableAdapter(com.jakdor.labday.view.adapter.TimetableAdapter) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 Path (com.jakdor.labday.common.model.Path)1 TimetableAdapter (com.jakdor.labday.view.adapter.TimetableAdapter)1