use of com.remswork.project.alice.service.impl.ClassServiceImpl 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.remswork.project.alice.service.impl.ClassServiceImpl in project classify-system by anverliedoit.
the class Home_Schedule_Slidebar_Fragment method init.
public void init() {
new Thread(new Runnable() {
@Override
public void run() {
try {
final List<Schedule> scheduleList = new ArrayList<>();
TeacherHelper teacherHelper = new TeacherHelper(getContext());
ClassServiceImpl classService = new ClassServiceImpl();
Class _class = null;
for (Class c : classService.getClassList()) {
if (c.getTeacher() == null)
continue;
if (c.getTeacher().getId() == teacherHelper.loadUser().get().getId()) {
_class = c;
Log.i("myTAG", "id : " + c.getId());
break;
}
}
// test
_class = classService.getClassById(40);
if (_class != null) {
for (Schedule schedule : classService.getScheduleList(_class.getId())) scheduleList.add(schedule);
}
handler.post(new Runnable() {
@Override
public void run() {
scheduleRecyclerView = (RecyclerView) customView.findViewById(R.id.shedule_recyclerview);
ScheduleAdapter scheduleAdapter = new ScheduleAdapter(getContext(), scheduleList);
scheduleRecyclerView.setAdapter(scheduleAdapter);
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
scheduleRecyclerView.setLayoutManager(layoutManager);
scheduleRecyclerView.setItemAnimator(new DefaultItemAnimator());
}
});
} catch (ClassException e) {
e.printStackTrace();
}
}
}).start();
}
use of com.remswork.project.alice.service.impl.ClassServiceImpl in project classify-system by anverliedoit.
the class GradeViewActivity 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<Student> studenList = new ArrayList<>();
final Set<Student> studentSet = classService.getStudentList(classId);
for (Student student : studentSet) studenList.add(student);
final StudentAdapter studentAdapter = new StudentAdapter(GradeViewActivity.this, studenList);
final LinearLayoutManager layoutManager = new LinearLayoutManager(GradeViewActivity.this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
handler.post(new Runnable() {
@Override
public void run() {
recyclerView.setAdapter(studentAdapter);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
if (studenList.size() < 1)
txtMsgContent.setVisibility(View.VISIBLE);
}
});
} catch (ClassException e) {
e.printStackTrace();
}
}
}).start();
}
use of com.remswork.project.alice.service.impl.ClassServiceImpl in project classify-system by anverliedoit.
the class StudentViewActivity 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<Student> studenList = new ArrayList<>();
final Set<Student> studentSet = classService.getStudentList(classId);
for (Student student : studentSet) studenList.add(student);
Collections.sort(studenList, new Comparator<Student>() {
@Override
public int compare(final Student object1, final Student object2) {
return object1.getLastName().compareTo(object2.getLastName());
}
});
final StudentAdapter studentAdapter = new StudentAdapter(StudentViewActivity.this, studenList);
final LinearLayoutManager layoutManager = new LinearLayoutManager(StudentViewActivity.this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
handler.post(new Runnable() {
@Override
public void run() {
recyclerView.setAdapter(studentAdapter);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
if (studenList.size() < 1)
txtMsgContent.setVisibility(View.VISIBLE);
}
});
} catch (ClassException e) {
e.printStackTrace();
}
}
}).start();
}
use of com.remswork.project.alice.service.impl.ClassServiceImpl 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