use of com.shu.studentmanager.entity.Course in project student-manager by SYYANI.
the class ScoreStudentAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(@NonNull ScoreStudentAdapter.ViewHolder holder, int position) {
if (scoreStudentList != null && scoreStudentList.size() > 0) {
Course courseStudentEntity = scoreStudentList.get(position);
holder.score_review_course_id_cid.setText(courseStudentEntity.getCid());
holder.score_review_course_name_cname.setText(courseStudentEntity.getCname());
holder.score_review_teacher_tid.setText(courseStudentEntity.getTid());
holder.score_review_teacher_tname.setText(courseStudentEntity.getTname());
holder.score_review_student_grade.setText(courseStudentEntity.getGrade());
holder.score_review_study_ccredit.setText(courseStudentEntity.getCcredit());
}
}
use of com.shu.studentmanager.entity.Course in project student-manager by SYYANI.
the class ScoreReviewFragment method initScoreReviewList.
private void initScoreReviewList() {
StudentManagerApplication application = (StudentManagerApplication) getActivity().getApplication();
String url = "http://101.35.20.64:10086/SCT/findBySid/" + application.getId() + "/" + application.getCurrentTerm();
new Thread() {
@Override
public void run() {
super.run();
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder().url(url).method("GET", null).build();
Response response;
try {
response = client.newCall(request).execute();
if (response.isSuccessful()) {
ArrayList<Course> slist = null;
slist = new Gson().fromJson(response.body().string(), new TypeToken<ArrayList<Course>>() {
}.getType());
scoreReviewViewModel.setMutableLiveData_score_review_score_list(slist);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}.start();
}
use of com.shu.studentmanager.entity.Course in project student-manager by SYYANI.
the class ScoreReviewFragment method setScoreListRecyclerview.
private void setScoreListRecyclerview() {
score_review_list_recyclerview.setHasFixedSize(true);
score_review_list_recyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));
scoreStudentAdapter = new ScoreStudentAdapter(getActivity());
score_review_list_recyclerview.setAdapter(scoreStudentAdapter);
scoreReviewViewModel.getMutableLiveData_score_review_score_list().observe(getActivity(), new Observer<ArrayList<Course>>() {
@Override
public void onChanged(ArrayList<Course> courses) {
scoreStudentAdapter.updateScoreStudentList(courses);
}
});
}
Aggregations