use of com.lieverandiver.thesisproject.adapter.ClassAdapter in project classify-system by anverliedoit.
the class SliderClassFragment method init.
public void init() {
new Thread(new Runnable() {
@Override
public void run() {
try {
List<Class> classList = new ClassServiceImpl().getClassListByTeacherId(new TeacherHelper(getContext()).loadUser().get().getId());
final ClassAdapter classAdapter = new ClassAdapter(getContext(), classList);
final RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getContext(), 2);
handler.post(new Runnable() {
@Override
public void run() {
recyclerView.setAdapter(classAdapter);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
progressBar.setVisibility(View.INVISIBLE);
}
});
} catch (ClassException e) {
e.printStackTrace();
}
}
}).start();
}
Aggregations