コード例 #1
0
 private void init(AttributeSet attrs) {
   int weekTextStyle;
   TypedArray typedArray = null;
   // 获取所有的资源文件
   if (attrs != null) {
     typedArray = mContext.obtainStyledAttributes(attrs, R.styleable.TtCalendar);
     // 星期是card
     weekTextStyle =
         typedArray.getResourceId(
             R.styleable.TtCalendar_weekTextStyle, R.style.textView_sp13_grey_bg_bold);
   } else {
     weekTextStyle = R.style.textView_sp13_grey_bg_bold;
   }
   inflate(mContext, R.layout.widget_calendar_pageview, this);
   setGravity(Gravity.CENTER_HORIZONTAL);
   setOrientation(LinearLayout.VERTICAL);
   LinearLayout weekdaysLl = (LinearLayout) this.findViewById(R.id.widget_calendar_card_weekdays);
   // 设置星期文字样式
   for (int i = 0; i < weekdaysLl.getChildCount(); i++) {
     View child = weekdaysLl.getChildAt(i);
     if (child instanceof TextView) {
       ((TextView) child).setTextAppearance(mContext, weekTextStyle);
     }
   }
   mCalendarCardView = (CalendarCardView) this.findViewById(R.id.widget_calendar_pageview_card);
   mCalendarCardView.setTypedArray(typedArray);
 }
コード例 #2
0
ファイル: CalendarView.java プロジェクト: wr4eng/konekti
  @Override
  public void downButtonClick(ClickNavigationEvent event) {
    Calendar calendarSelected = null;

    if (bsCalendar.getItemIds().size() > 0) {
      // get selected Organization
      calendarSelected = (Calendar) bsCalendar.getItemId();

      // inject the locations data from organization in the detail Location View
      CalendarCardView calendarDetailViewView = (CalendarCardView) viewContainer.getNext();
      calendarDetailViewView.setCalendar(calendarSelected);

      // roll to the detail Location View
      viewContainer.getSliderView().rollNext();
    }
  }
コード例 #3
0
 public void setOnDaySelectListener(OnDaySelectedChangedListener onDaySelectListener) {
   mCalendarCardView.setOnDaySelectListener(onDaySelectListener);
 }
コード例 #4
0
 public void selectCal(Calendar selectedCal) {
   mCalendarCardView.selectCal(selectedCal);
 }
コード例 #5
0
 public void setCurrentMonth(Calendar currentMonth) {
   mCalendarCardView.setCurrentMonth(currentMonth);
 }