Search in sources :

Example 1 with ShowDetailDialog

use of com.mnnyang.gzuclassschedule.utils.spec.ShowDetailDialog 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);
        }
    });
}
Also used : DialogHelper(com.mnnyang.gzuclassschedule.utils.DialogHelper) DialogInterface(android.content.DialogInterface) CourseView(com.mnnyang.gzuclassschedule.custom.course.CourseView) Intent(android.content.Intent) View(android.view.View) TextView(android.widget.TextView) CourseView(com.mnnyang.gzuclassschedule.custom.course.CourseView) RecyclerView(android.support.v7.widget.RecyclerView) ShowDetailDialog(com.mnnyang.gzuclassschedule.utils.spec.ShowDetailDialog) CourseV2(com.mnnyang.gzuclassschedule.data.beanv2.CourseV2) AddActivity(com.mnnyang.gzuclassschedule.mvp.add.AddActivity) DialogListener(com.mnnyang.gzuclassschedule.utils.DialogListener) CourseAncestor(com.mnnyang.gzuclassschedule.custom.course.CourseAncestor)

Example 2 with ShowDetailDialog

use of com.mnnyang.gzuclassschedule.utils.spec.ShowDetailDialog in project GzuClassSchedule by mnnyang.

the class CourseActivity method onClick.

@Override
public void onClick(Course course, LinearLayout itemLayout) {
    mDialog = new ShowDetailDialog();
    mDialog.show(this, course, new PopupWindow.OnDismissListener() {

        @Override
        public void onDismiss() {
            mDialog = null;
        }
    });
}
Also used : PopupWindow(android.widget.PopupWindow) ShowDetailDialog(com.mnnyang.gzuclassschedule.utils.spec.ShowDetailDialog)

Aggregations

ShowDetailDialog (com.mnnyang.gzuclassschedule.utils.spec.ShowDetailDialog)2 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 PopupWindow (android.widget.PopupWindow)1 TextView (android.widget.TextView)1 CourseAncestor (com.mnnyang.gzuclassschedule.custom.course.CourseAncestor)1 CourseView (com.mnnyang.gzuclassschedule.custom.course.CourseView)1 CourseV2 (com.mnnyang.gzuclassschedule.data.beanv2.CourseV2)1 AddActivity (com.mnnyang.gzuclassschedule.mvp.add.AddActivity)1 DialogHelper (com.mnnyang.gzuclassschedule.utils.DialogHelper)1 DialogListener (com.mnnyang.gzuclassschedule.utils.DialogListener)1