Ejemplo n.º 1
0
 /** ��ʼ��schdule ҳ�� */
 private void initSchdule() {
   lvDays = (ListView) mView.findViewById(R.id.lvScheduleCalendarDays);
   calendarComponent = (CalendarComponent) mView.findViewById(R.id.ccSchedule);
   calendarComponent.setExtentionCalendar(true);
   tvMonth = (TextView) mView.findViewById(R.id.tvScheduleCalendarMonth);
   tvMonth.setTypeface(StringUtil.getTypeFaceByRegular(getActivity()));
   llCalendarComponent = (LinearLayout) mView.findViewById(R.id.llScheduleCalendar);
   initData();
 }
Ejemplo n.º 2
0
 public void handleMessage(Message msg) {
   super.handleMessage(msg);
   @SuppressWarnings("unchecked")
   ArrayList<FDEvent> newEvents = (ArrayList<FDEvent>) msg.obj; // 		
   if (events == null) {
     events = new ArrayList<FDEvent>();
   } else {
     events.clear();
   }
   if (newEvents != null) {
     events.addAll(newEvents);
   }
   if (calendarComponent != null) calendarComponent.checkEvents(events, mSocialEvents);
   if (eAdapter != null) eAdapter.notifyDataSetChanged();
 }
Ejemplo n.º 3
0
 /** ��ʼ���б����� */
 private void initData() {
   listDay = calendarComponent.getListDay();
   calendarComponent.setOnMonthChangeListener(
       new MonthChangeListener() {
         public void changeMonth(CalendarComponent calendar, FDDay day) {
           nowMonthOfDay = day;
           if (!isCalendarHiden) {
             //					setMonthTitle(day);
           } else {
             //					tvMonth.setText(nowMonthOfDay.getYear()+"");
           }
         }
       });
   calendarComponent.setOnHideListener(
       new BackgroundHideListener() {
         public void hideBG(CalendarComponent calendar, boolean isHide) {
           isCalendarHiden = isHide;
           if (nowMonthOfDay != null) {
             if (isHide) {
               //						tvMonth.setText(nowMonthOfDay.getYear()+"");
             } else {
               //						setMonthTitle(nowMonthOfDay);
             }
           }
         }
       });
   calendarComponent.setOnSelectedDayListener(
       new OnDaySelectedListener() {
         public void onSelected(CalendarAdapter adapter, FDDay day) {
           //				selectedDay = day;
           if (day != null) {
             if (lvDays != null && day != null) {
               lvDays.setSelection(day.getIndexInCalendar());
             }
           }
         }
       });
   eAdapter = new CalendarDaysAdapter();
   lvDays.setAdapter(eAdapter);
   FDDay td = calendarComponent.getcAdapter().getSelectedDay();
   today = td.clone();
   //		selectedDay = today.clone();
   currentDayIndex = calendarComponent.getCalendar().getCurrentTodayIndex();
   lvDays.setSelection(currentDayIndex);
   lvDays.setOnScrollListener(new DaysLVOnScrollListener());
 }