use of com.mnnyang.gzuclassschedule.custom.course.CourseAncestor in project GzuClassSchedule by mnnyang.
the class CourseActivity method initCourseViewEvent.
/**
* courseVIew事件
*/
private void initCourseViewEvent() {
mCourseViewV2.setOnItemClickListener(new CourseView.OnItemClickListener() {
@Override
public void onClick(List<CourseAncestor> course, View itemView) {
mDialog = new ShowDetailDialog();
mDialog.show(CourseActivity.this, (CourseV2) course.get(0), new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
mDialog = null;
}
});
}
@Override
public void onLongClick(List<CourseAncestor> courses, View itemView) {
final CourseV2 course = (CourseV2) courses.get(0);
DialogHelper dialogHelper = new DialogHelper();
dialogHelper.showNormalDialog(CourseActivity.this, getString(R.string.confirm_to_delete), "课程 【" + course.getCouName() + "】" + Constant.WEEK[course.getCouWeek()] + "第" + course.getCouStartNode() + "节 ", new DialogListener() {
@Override
public void onPositive(DialogInterface dialog, int which) {
super.onPositive(dialog, which);
deleteCancelSnackBar(course);
}
});
}
public void onAdd(CourseAncestor course, View addView) {
Intent intent = new Intent(CourseActivity.this, AddActivity.class);
intent.putExtra(Constant.INTENT_ADD_COURSE_ANCESTOR, course);
intent.putExtra(Constant.INTENT_ADD, true);
startActivity(intent);
}
});
}
Aggregations