use of dz.easy.androidclient.Adapters.TimeTableStudentAdapter in project easy by MehdiBenmesa.
the class TimeTableFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
//Use this now
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
try {
if (user.getString("_type").equals("Student")) {
mRecyclerView.setAdapter(new TimeTableStudentAdapter(user));
} else if (user.getString("_type").equals("Manager")) {
mRecyclerView.setAdapter(new TimeTableManagerAdapter(user));
} else {
mRecyclerView.setAdapter(new TimeTableTeacherAdapter(user));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
Aggregations