use of com.lieverandiver.thesisproject.adapter.ScheduleAdapter in project classify-system by anverliedoit.
the class ScheduleViewActivity method initRView.
public void initRView(final long classId) {
final Handler handler = new Handler(getMainLooper());
new Thread(new Runnable() {
@Override
public void run() {
try {
final ClassServiceImpl classService = new ClassServiceImpl();
final List<Schedule> scheduleList = new ArrayList<>();
final Set<Schedule> scheduleSet = classService.getScheduleList(classId);
for (Schedule schedule : scheduleSet) scheduleList.add(schedule);
final ScheduleAdapter scheduleAdapter = new ScheduleAdapter(ScheduleViewActivity.this, scheduleList);
final LinearLayoutManager layoutManager = new LinearLayoutManager(ScheduleViewActivity.this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
handler.post(new Runnable() {
@Override
public void run() {
recyclerView.setAdapter(scheduleAdapter);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
if (scheduleSet.size() < 1)
txtMsgContent.setVisibility(View.VISIBLE);
}
});
} catch (ClassException e) {
e.printStackTrace();
}
}
}).start();
}
use of com.lieverandiver.thesisproject.adapter.ScheduleAdapter in project classify-system by anverliedoit.
the class SliderScheduleFragment method init.
public void init() {
Collections.sort(scheduleList, new Comparator<Schedule>() {
@Override
public int compare(Schedule o1, Schedule o2) {
return (o1.getTime().compareTo(o2.getTime()));
}
});
scheduleRecyclerView = (RecyclerView) customView.findViewById(R.id.shedule_recyclerview);
scheduleAdapter = new ScheduleAdapter(getContext(), scheduleList);
scheduleRecyclerView.setAdapter(scheduleAdapter);
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
scheduleRecyclerView.setLayoutManager(layoutManager);
scheduleRecyclerView.setItemAnimator(new DefaultItemAnimator());
scheduleRecyclerView.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.INVISIBLE);
}
Aggregations