Search in sources :

Example 1 with PopupWindowDialog

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

the class AddActivity method clickLocationItem.

private void clickLocationItem(final LinearLayout locationItem) {
    PopupWindowDialog dialog = new PopupWindowDialog();
    CourseV2 courseV2 = null;
    Object obj = locationItem.getTag();
    // has tag data
    if (obj != null && obj instanceof CourseV2) {
        courseV2 = (CourseV2) obj;
    } else {
        throw new RuntimeException("Course data tag not be found");
    }
    dialog.showSelectTimeDialog(this, courseV2, new PopupWindowDialog.SelectTimeCallback() {

        @Override
        public void onSelected(CourseV2 course) {
            StringBuilder builder = new StringBuilder();
            builder.append("周").append(Constant.WEEK_SINGLE[course.getCouWeek() - 1]).append(" 第").append(course.getCouStartNode()).append("-").append(course.getCouStartNode() + course.getCouNodeCount() - 1).append("节");
            if (!TextUtils.isEmpty(course.getCouLocation())) {
                builder.append("【").append(course.getCouLocation()).append("】");
            }
            ((TextView) locationItem.findViewById(R.id.tv_text)).setText(builder.toString());
        }
    });
}
Also used : CourseV2(com.mnnyang.gzuclassschedule.data.beanv2.CourseV2) PopupWindowDialog(com.mnnyang.gzuclassschedule.utils.spec.PopupWindowDialog)

Aggregations

CourseV2 (com.mnnyang.gzuclassschedule.data.beanv2.CourseV2)1 PopupWindowDialog (com.mnnyang.gzuclassschedule.utils.spec.PopupWindowDialog)1